You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR in ./src/components/App.js 5:9
Module parse failed: Unexpected token (5:9)
You may need an appropriate loader to handle this file type.
| import lazy from '@loadable/component';| var Top = lazy(function () {
>return import('@components/Top');| });| var Login = lazy(function () {
@ ./src/client/client.js 9:0-34 18:66-69
Version
"webpack": "^4.29.0",
"@babel/cli": "^7.2.3",
"@babel/core": "7.0.0",
"@babel/plugin-transform-runtime": "^7.2.0",
"@loadable/component": "^5.9.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
npm v 6.7.0
node v11.12.0
Test Scenario
Error Log
Cause
You can check details in Parsing of
import()
fails in 4.29.0 (Compilation issue, related to dynamic import) webpack/webpack#8656 (comment)Solution
For solving this problem, you can have three options.
yarn
instead ofnpm
.yarn add -D acorn@^6.1.1 # or npm install -D acorn@^6.1.1
update npm to v6.8.0-next.2+ (https://github.com/npm/cli/releases/tag/v6.8.0-next.2)Install package
Reference
import()
fails in 4.29.0 (Compilation issue, related to dynamic import) webpack/webpack#8656 (comment)The text was updated successfully, but these errors were encountered: