brunolemos/react-native-web-monorepo

Module parse failed: Unexpected token on yarn eject

sachinKumarGautam opened this issue · 1 comments

I am having this error after eject

Uncaught Error: Module parse failed: Unexpected token (15:8)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

export function App() {
return (
<React.Fragment>

I am not able to figure out what do I have to update in webpack.config.js as babel-loader is present to compile js and ts files

"@babel/core": "7.5.5",
"babel-loader": "8.0.6",

Steps to replicate
Project is hosted at https://github.com/sachinKumarGautam/Virtual-Chips
Clone it
yarn install
yarn workspace web start

@brunolemos pls look into this
Let me know if more info required
Screenshot 2019-09-17 at 9 36 30 PM

Hi,

Sounds like your app stopped recognizing JSX that is outside the src folder.

This project currently uses react-app-rewired to make that work: https://github.com/sachinKumarGautam/Virtual-Chips/blob/f5feb926ff8824f0aabc9d7e1ba7038e3e601a48/packages/web/config-overrides.js#L11

I don’t think react-app-rewired supports ejected projects, so you will need to add the changes above to the webpack config manually.

Anyway, I don’t recommend ejecting. I’ve never ejected so I can’t give more help than this.