SyntaxError: Unexpected token \ in compiler.js
See original GitHub issueI got an error while running webpack. The cause of error seems to be JSON.parse(childCompilation.assets[outputName].source()) in the compiler.js.
webpack.config.js:
var FaviconsWebpackPlugin = require('favicons-webpack-plugin');
...
plugins: [
...
new FaviconsWebpackPlugin('./client/assets/favicon.png')
]
Log:
/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/webpack-core/lib/NormalModuleMixin.js:151
throw e;
^
SyntaxError: Unexpected token \
at Object.parse (native)
at /Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/favicons-webpack-plugin/lib/compiler.js:83:23
at Compiler.<anonymous> (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/webpack/lib/Compiler.js:214:10)
at /Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/webpack/lib/Compiler.js:403:12
at Compiler.next (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/tapable/lib/Tapable.js:67:11)
at Compiler.<anonymous> (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/webpack/lib/CachePlugin.js:40:4)
at Compiler.applyPluginsAsync (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/tapable/lib/Tapable.js:71:13)
at Compiler.<anonymous> (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/webpack/lib/Compiler.js:400:9)
at Compilation.<anonymous> (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/webpack/lib/Compilation.js:577:13)
at Compilation.applyPluginsAsync (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/tapable/lib/Tapable.js:60:69)
at Compilation.<anonymous> (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/webpack/lib/Compilation.js:572:10)
at Compilation.next (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/tapable/lib/Tapable.js:67:11)
at Compilation.<anonymous> (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/favicons-webpack-plugin/lib/compiler.js:57:7)
at Compilation.applyPluginsAsync (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/tapable/lib/Tapable.js:71:13)
at Compilation.<anonymous> (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/webpack/lib/Compilation.js:567:9)
at Compilation.applyPluginsAsync (/Users/lvarayut/Documents/Web development/Projects/relay-fullstack/node_modules/tapable/lib/Tapable.js:60:69)
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >Have a JavaScript Unexpected Token Error? Check Your Syntax
This JavaScript error is a subset of the SyntaxError. That means it only appears when attempting to execute code with an extra (or...
Read more >JavaScript SyntaxError - Unexpected token - GeeksforGeeks
This JavaScript exceptions unexpected token occur if a specific language construct was expected, but anything else is typed mistakenly.
Read more >Uncaught SyntaxError: Unexpected token : - Stack Overflow
An "unexpected token" is likely some illegal character code. Such a code is likely not to show up when you print to console....
Read more >How to fix: "SyntaxError: Unexpected token" in JavaScript
One common cause of the SyntaxError: Unexpected token error is a missing semicolon. In JavaScript, semicolons are used to indicate the end ...
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 got the exact same result as @leMaik. It seems like the result of
childCompilation.assets[outputName].source()has been escaped many times.will be fixed by tomorrow