-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webpack-cli ERROR:Unexpected token = #176
Comments
webpack-dev-server使用了新的定义class成员的语法,你可以升级你的node版本试试 |
好的谢谢 |
Just translated @jayzun answer, it helped me. |
@g1un what version did you need to update to? |
Same problem. I'm using webpack serve --config ./webpack.config.ts |
Definitely upgrading NodeJs helps. The static variables syntax is available in Node 6, but the static class variable that's used here is available in Node 12.6. Going to the latest LTS is recommended to solve the issue. |
When starting the project,webpack-cli throws an error:
SyntaxError: Unexpected token =
The configuration in the .babelrc file is:
{ "presets": [ ["env", { "modules": false }], "stage-2", "es2015" ], "plugins": ["transform-runtime"], "comments": false }
`[webpack-cli] D:\lifeRestart\my-project\node_modules\webpack-dev-server\lib\servers\WebsocketServer.js:10
static heartbeatInterval = 1000;
^
SyntaxError: Unexpected token =
at new Script (vm.js:83:7)
at NativeCompileCache._moduleCompile (D:\lifeRestart\my-project\node_modules\v8-compile-cache\v8-compile-cache.js:240:18)
at Module._compile (D:\lifeRestart\my-project\node_modules\v8-compile-cache\v8-compile-cache.js:184:36)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
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 (D:\lifeRestart\my-project\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Server.getServerTransport (D:\lifeRestart\my-project\node_modules\webpack-dev-server\lib\Server.js:982:28)`
The text was updated successfully, but these errors were encountered: