Reputation:
I'm new to react and i started an app using create react app.When i try to rename index.js to index.jsx, I'm getting an error saying "Module build failed: Error: ENOENT: no such file or directory, open '/home/qbuser/Desktop/onChat-final/new/chat/client/src/index.js'". What should be done? Where did I go wrong?
Upvotes: 17
Views: 18088
Reputation: 1435
You need to restart the app after renaming. I fail to find a reason for this but the solution works.
Ctrl + C
.npm start
. Upvotes: 9
Reputation: 569
It's a bug with create-react-app dev server: it can't handle renaming of index.js to index.jsx and vice versa. Just restart your dev server
Upvotes: 47
Reputation:
Rename it back to index.js. The file can still contain JSX.
Or run "eject"/ use WebPack, then you can customize anything.
Upvotes: -10