question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webpackOk causes JSON.parse exception in postmessage

See original GitHub issue

Do 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.

screen shot 2017-02-04 at 12 21 14 pm

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:closed
  • Created 7 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
chaitanyaankamcommented, Jul 23, 2021

I am experiencing the same issue with angular. can you guys let me know if there is any workaround?

1reaction
drtyh2ocommented, Feb 15, 2018

@amir-beheshty Not really. The issue I was having wasn’t with webpack-dev-server or even postmessage for that matter. The exception in my case was caused by another package I was using, called seamless.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found