_Please make sure you have read the submission guidelines before posting an issue_
Build of React Application should be succeed as it was before update.
Build of React Application is failed with an error.
ERROR in ./main.tsx 4:16
Module parse failed: Unexpected token (4:16)
File was processed with these loaders:
ReactDOM.render(
, document.getElementById('root'));
I just upgraded from 8.2.0 to 8.7.0 and I am seeing the same error in my React project.
Actually the same issue for 8.6 version. But if create workspace from scratch and add React app - everything is fine.
Could someone please provide a repo with the issue to aid our investigation into this issue.
Hi. I have found how to reproduce from scratch.
You will see an error:
ERROR in ./main.tsx 4:16
Module parse failed: Unexpected token (4:16)
File was processed with these loaders:
ReactDOM.render(
, document.querySelector("react-nx-bug-root"));
Hi @FrozenPandaz and @vsavkin , can you look at this issue please. Maybe you need some additional info. It is still reproduced for me when I try to update to Nx 8.8.0
Hi @vsavkin. I have found a solution for current issue. After update of Nx packages webpackConfig property should be added to each react application inside angular.json file in the "options" section. The value should be a path @nrwl/react/plugins/webpack.
Thus during migration webpackConfig is not added to react app settings.
@kazamov it seems we didn't add webpackConfig option during the upgrade. I'll add it to the next version. For now adding the "webpackConfig": "@nrwl/react/plugins/webpack" to the builder options is the work around.
PR for adding migration for 8.12.0 to handle React projects with missing webpackConfig: https://github.com/nrwl/nx/pull/2352
Note, if your workspace is missing @babel/preset-react then make sure you install it. This dependency is installed automatically when you create a new React app.