I'm using webpack in a .Net project to bundle my javascript files. I recently ran into a bug that I'd like to debug using chrome dev tools.
In my webpack config file, I added the following line to generate source maps.
devtool: 'source-map'
After running npx webpack
the following files were generated in my dist
folder.
So I know for sure these files were generated. When I open up resources.entry.js in the chrome debugger, I see the following.
However, I can't seem to actually find the source map so that I can place a break point. I can't find it in the tree.
and I can't seem to do a ctrl + p
to search for it like Chrome suggests.
What exactly do I need to do to be able to debug using my source javascript files?
Thank you.
Browser support To enable source maps in Google Chrome, go to Developer Tools, click the little cog icon, and then make sure that “Enable Javascript source maps” is checked. That's it.
You need to manually add the source maps in dev-tools. Following are the steps.
Also, make sure you have sourcemaps enabled. (Check this: https://developers.google.com/web/tools/chrome-devtools/javascript/source-maps)
Update: Its available in chrome 85 as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With