I am working with react-script 2.1.8 version. I have got an issue while integrating third party node-module as it throws syntax(babel) related error. react-script is no config library which means i can't define plugin/preset for bable(.babelrc and webpack config does not work.)
please suggest me some solution which can resolve babel issue by defining config or suggest some other way to integrate this library with my project
I've tried to resolve the issue with 'react-app-rewired'and for configuration 'arackaf/customize-cra'. but still errors persist.
import React from 'react';
import ReactDOM from 'react-dom';
import Vr from './vr/Vr.jsx';
const MOUNT_NODE = document.getElementById('root');
const render = () => {
ReactDOM.render(
<div/>,
MOUNT_NODE
);
};
export Vr from './vr/Vr.jsx';
render();
ERROR 1: Unexpected token (10:3)
ReactDOM.render(
<div/>, ^ MOUNT_NODE); };
ERROR 2: };
export Vr from './vr/Vr.jsx'; ^ render();
Add @babel/plugin-proposal-export-default-from (https://git.io/vb4yH) to the 'plugins' section of your Babel config to enable transformation.
Note: this error is related to react preset and babel plugin respectively . But somehow babel config is not working with this third party module(node-module).