"SyntaxError: Unexpected token *" issue
See original GitHub issuehi @wellyshen @Rid, Do you guys have experience with below issue, I got stuck with it for a day, and still don’t know how to fix. Please help me 😃.
I think it does not understand
ES6 syntax
onserver side
Before add babel-loader
config to config.babel.js
, I got below error
After add this configuration to config.babel.js
, I solved this error
but still remain below error:
Error details:
/working/source/examples/react-cool-starter/node_modules/@ansarada/ace-react/dist/ace/components/index.js:4 import * as editor from ‘./Editor’; ^
SyntaxError: Unexpected token * at Module._compile (internal/modules/cjs/loader.js:723:23) at Module._compile (/working/source/examples/react-cool-starter/node_modules/pirates/lib/index.js:99:24) at Module._extensions…js (internal/modules/cjs/loader.js:789:10) at Object.newLoader [as .js] (/working/source/examples/react-cool-starter/node_modules/pirates/lib/index.js:104:7) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/working/source/examples/react-cool-starter/src/pages/Home/Home.js:6:1) at Module._compile (internal/modules/cjs/loader.js:778:30) at Module._compile (/working/source/examples/react-cool-starter/node_modules/pirates/lib/index.js:99:24) at Module._extensions…js (internal/modules/cjs/loader.js:789:10) at Object.newLoader [as .js] (/working/source/examples/react-cool-starter/node_modules/pirates/lib/index.js:104:7) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at Object.requireSync (/working/source/examples/react-cool-starter/src/pages/Home/index.js:6:14) at InnerLoadable.loadSync (/working/source/examples/react-cool-starter/node_modules/@loadable/component/dist/loadable.cjs.js:188:35) at new InnerLoadable (/working/source/examples/react-cool-starter/node_modules/@loadable/component/dist/loadable.cjs.js:128:17) at processChild (/working/source/examples/react-cool-starter/node_modules/react-dom/cjs/react-dom-server.node.development.js:2846:14) ==> 😭 Rendering routes error: SyntaxError: Unexpected token * GET / 404 14429.555 ms - 12
Content of the component which cause issue
The line which cause issue
Thank you so much.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Please confirm that your package.json contains:
Do you have a link to the repository you’re working from?
@hienhuynhtm can you let us know the command you’re running when you get this error?
i.e. yarn dev or yarn build && yarn start