I am following simple tutorials like https://github.com/YaroslavW/react-min-setup-abc to create a new React application from scratch (using webpack 4 and babel 7 instead of create-react-app from react-scripts).
I am getting the same error as ReactJS Module build failed: SyntaxError: Unexpected token - ReactDOM.render (Sorry for possible duplicate but none of the solutions from this thread are working for me).
SyntaxError: C:\...\src\index.js: Unexpected token (7:2)
5 |
6 | ReactDOM.render(
> 7 | <div>{title}</div>,
| ^
8 | document.getElementById('app')
9 | );
Seems that this repo was working fine but suddenly became broken. I haven't done any changes after pulling from the github. Many tutorials also lead to the same code and the same error.
Seems the solution should be adding @babel/preset-react
to the .babelrc
file but it is already there in the repo.
Are new versions of the toolset not compatible with eath other or is there any misconfiguration in the repo?
I am using Windows 10 x64, Nodejs 10.16.3 abd Npm 6.9.0. Other libraries are unchanged from the repo.
Important information: the issue can only be reproduced when running node.js commands from a Windows symbolic linked path (e.g. using mklink command).