`eval-source-map` issue with Hot Module Replacement
See original GitHub issueBug report
What is the current behavior?
source-map does not work correctly with devtool: eval-source-map
when app hot updating. If the hot-updated code causes runtime error, we will get something like:
VM3252 utils.ts:6 Uncaught TypeError: Cannot read property 'b' of undefined
at echo (VM3252 utils.ts:6)
at eval (index.ts?a959:5)
in which the stack info is not source-mapped correctly.
If the current behavior is a bug, please provide the steps to reproduce.
I created a demo here: https://github.com/nighca/webpack-eval-source-map. Follow the README and we can reproduce the bug.
What is the expected behavior?
The hot-updated code should be source-mapped correctly, and the stack info of runtime error should be like:
utils.ts?8813:2 Uncaught TypeError: Cannot read property 'b' of undefined
at echo (utils.ts?8813:2)
at eval (index.ts?a959:5)
Other relevant information: webpack version: 5.46.0 Node.js version: v14.16.1 Operating System: macOS Additional tools:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Webpack hot module replacement (HMR) sourcemaps not ...
There is an issue with HMR and updating the source maps in the DevTools. Typically, the source maps are cached by the browsers...
Read more >Webpack Hot Module Replacement (HMR) doesn't update ...
I tried different sourcemap types and checked it in Chrome and Firefox with no success. But I think it's a browser level bug....
Read more >Webpack dev server, Hot reload and source maps - Medium
For development we will be using eval-source-map which provide the original source. To do this we just add this line to our webpack...
Read more >EvalSourceMapDevToolPlugin - webpack
You can use the following code to replace the configuration option devtool: eval-source-map with an equivalent custom plugin configuration: module.exports ...
Read more >Hot Module Replacement - SurviveJS
Hot Module Replacement (HMR) builds on top of the WDS. It enables an interface that makes it possible to swap modules live. For...
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 FreeTop 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
Top GitHub Comments
Reported - https://bugs.chromium.org/p/chromium/issues/detail?id=1237014
I’m getting the same issue with node server script. I’m using class and trying to call private method using
this
keyword, but gettingundefined
context.So the question, is it chrome issue?
UPDATE: I solved my issues by binding the context with the method inside contstuctor which is a bit off to me but it works!
Not sure if this is bable issue or webpack honestly! But we hopefully get some explaination.