I'm logging javascript errors from my site, but the files are minimized so I don't get meaningful line numbers. I do have source maps, however.
Is there a service, script, npm module, or anything that can help me "translate" the line numbers from the minified versions into something useful?
Adds source mappings and base64 encodes them, so they can be inlined in your generated file. var generator = require('inline-source-map'); // default charset 'utf-8' is configurable.
Enter the Sourcemap A sourcemap is a mapping between the generated/transpiled/minified JavaScript file and one or more original source files. The main purpose of sourcemaps is to aid debugging. Basically, if there's an error in the generated code file, the map can tell you the original source file location. That's it.
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.
I have found the answer using this npm module:
https://www.npmjs.org/package/source-map
Edit Feb 1st, 2015
Found the following project which handles this: https://github.com/epeli/source-map-peek
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