webpack/webpack-dev-server 2 throws `ERROR in json.js - Parenthesized pattern`
See original GitHub issueDo you want to request a feature or report a bug?
Report an error. But it could be user error. 😃
What is the current behavior?
When running webpack-dev-server I get the error:
ERROR in ./~/json3/lib/json3.js
Module parse failed: /node_modules/json3/lib/json3.js Parenthesized pattern (89:12)
You may need an appropriate loader to handle this file type.
| if (stringifySupported) {
| // A test function object with a custom `toJSON` method.
| (value = function () {
| return 1;
| }).toJSON = value;
@ ./~/sockjs-client/lib/main.js 7:12-28
@ ./~/sockjs-client/lib/entry.js
@ (webpack)-dev-server/client/socket.js
@ (webpack)-dev-server/client?http://localhost:8080
@ multi (webpack)-dev-server/client?http://localhost:8080 ./main.tsx
If the current behavior is a bug, please provide the steps to reproduce.
My configuration for a React + TypeScript project:
module.exports = {
context: __dirname + "/src",
entry: "./main.tsx",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
},
devServer: {
contentBase: __dirname + "/src",
},
devtool: "source-map",
resolve: {
extensions: [".tsx", ".ts", ".js"]
},
module: {
loaders: [
{
test: /\.tsx?$/,
loader: "ts-loader",
exclude: /node_modules/
}
]
}
}
This config works without problems using webpack-dev-server@1 (the only config difference being "" added to extensions: ["", ".tsx", ".ts", ".js"] ).
I am not using json3 directly in code anywhere.
What is the expected behavior?
No error.
Please mention your webpack and Operating System version.
- webpack/webpack-dev-server 2.2.1
- OSX 10.11.4
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Resolving "Parsing error: Parenthesized pattern" in pure js
I'm working on a simple assignment for a job training with html and js. There is an online code ...
Read more >SyntaxError: JSON.parse: bad parsing Breaking Your Code ...
parse() method, the method expects properly formatted JSON as the first argument. When it detects invalid JSON, it throws a JSON Parse error....
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 Free
Top 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

I can confirm that installing acorn 4.0.7 manually fixes the issue
It seems to have been the acorn issue… I blew away node_modules and re-installed
webpack@2 webpack-dev-server@2and the problem no longer exists, when I look at the acorn package it is using4.0.8which apparently fixed the issue.