Webpack "Unexpected Token" error in Create React App and other webpack based libraries
See original GitHub issueI’m trying to use Grid Engine in a React app and am running into a problem getting it to build. At this point, I’m unable to even import GridEngine
. without an “Unexpected Token” error.
I’ve been able to replicate this error using Create React App, Gatsby, Storybook, as well as code sandbox. Is this a known error and the library is simply not compatible with these environments, or am I missing something from the docs?
Minimal Create React App repo demonstrating problem - https://github.com/mikedane/grid-engine-bug-demo Code Sandbox repo with similar error - https://codesandbox.io/s/cool-worker-q0cgv?file=/src/App.js
Any help would be appreciated!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How do I fix the error, "Unexpected token (1:61)" in React?
Update - I went into the package.json and changed the react-scripts to 4.0.1 and re-ran npm install and it fixed the issue.
Read more >Unexpected token (7:2) You may need an appropriate loader ...
SyntaxError: Unexpected token (7:2) means there is a syntax error on line 7, column 2 in d:\src\react-my-create-react-app-created\src\index.js .
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...
Read more >babel-loader - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >How to add React Native Web to an existing ... - Aryan Goharzad
This post covers the most customizable method of adding web support to a plain React Native app using webpack and react-native-web .
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
Looks like the patch fixed it! Can confirm it’s working now. Thanks for the quick response, loving this library!
@Annoraaq It’s fixed! thanks for the quick reply