webpackOk causes JSON.parse exception in postmessage
See original GitHub issueDo you want to request a feature or report a bug? Report a bug
What is the current behavior?
Webpack Dev Server sends a webpackOk message with an undefined data property. This causes a JSON.parse exception in postmessage which results in a console warning that while not service affecting, does somewhat inhibit debugging by cluttering the console log.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Properly format the webpackOk message to avoid the JSON.parse exception and console warning.
Please mention your webpack and Operating System version. Webpack 2.2.1
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Proper way to catch exception from JSON.parse - Stack Overflow
i post something into an iframe then read back the contents of the iframe with json parse...so sometimes it's not a json string....
Read more >HTML5 window.postMessage - David Walsh Blog
A typical reason iframes are used is because the two parties have no control over each other so you can't know for certain...
Read more >SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
The JavaScript exceptions thrown by JSON.parse() occur when string failed to be parsed as JSON.
Read more >postMessage JSON: encoding / decoding - Google Groups
contentScript and my main.js, everything sent through postMessage needs to be encoded in JSON yeah? ... I believe that JSON.parse() and JSON.stringify() are...
Read more >webpackOk causes JSON.parse exception in postmessage ...
webpackOk causes JSON.parse exception in postmessage - JavaScript webpack-dev-server. Do you want to request a feature or report a bug? Report a bug....
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 am experiencing the same issue with angular. can you guys let me know if there is any workaround?
@amir-beheshty Not really. The issue I was having wasn’t with
webpack-dev-serveror evenpostmessagefor that matter. The exception in my case was caused by another package I was using, called seamless.