Unexpected token "<" on index.js after npm eject.
See original GitHub issueIs this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
token, eject, start, server, webpack, <
Environment
node -v
: 8.9.1npm -v
: 5.5.1
Then, specify:
- Operating system: macOS 10.12.6
- Browser and version (if relevant): Firefox Quantum Developer Edition 58
Steps to Reproduce
- Eject your create-react-app
- Stop any currently running
npm start
s. - Run
npm start.
- Cry.
Expected Behavior
I expected the development server to run like normal and serve up my application with no errors, since I hadn’t changed my project at all since eject
ion.
Actual Behavior
Instead, the development server spat out this error:
Reproducible Demo
I was able to reproduce this behaviour by deleting everything from my project except the basic files, index.js
and App.js
(which I made as basic as possible). You can get it here:
https://bitbucket.org/christopherdumas/kairos/branch/eject.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Unexpected token '.' when run create-react-app - Stack Overflow
I am trying to create a new React app using this command on Windows using Node 16.14. npx create- ...
Read more >How To Fix Unexpected Token Error for NPM Package in react ...
Are you getting this error with react-leaflet or other packages. If you are then it's most likely related to babel and there is...
Read more >[Solved]-Jest with Create React App: Test suite failed to run
Coding example for the question Jest with Create React App: Test suite failed to run - Unexpected token-Reactjs.
Read more >eslint-config-react-app - npm
If you want to use this ESLint configuration in a project not built with Create React App, you can install it with the...
Read more >JavaScript Error Handling: Unexpected Token - GeeksforGeeks
Example 3: An unexpected token ')' occur after i++ which JavaScript cannot recognize.We can remove error here by removing extra ).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@christopherdumas it’s because you have a
.babelrc
file which doesn’t contain anything required to compile React, ES6+, etc. Delete that file and things should start working.This commit would’ve caused the break.
Altering your
.babelrc
to add thereact-app
preset should also fix it.Oh, okay. Thank you!