Raygun can't use source maps generated by webpack
alexmac
Posted on
Nov 07 2016
I'm using webpack as a build tool. Looks like Raygun doesn't understand the format of source maps generated by webpack. It shows error description (with row and column) in generated, minified file, instead of source file.
Please check two attached source files, the first one is a source file, the second one is a generated map file.
Alex
Posted on
Nov 07 2016
Hi Alex,
It looks like your source maps files themselves are fine but there are a few other issues preventing source maps from being applied.
If you click "Re-process this error for Source Maps" you should see a dialog after the processing is finished outlining what issues our source mapper had.
In this case it appears that after retrieving the files referenced in the stack trace we couldn't find any source map comments. These are comments at should appear at the bottom of the minified file that look like this:
//# sourceMappingURL=mymapfile.js.map
As this is missing we cannot determine which map file to use to map the minified stacktrace.
It also looks like you have some files uploaded to the source map center. These files appear to be listed at a different URL scheme than your website (there is an extra "/script/" section in the path of the files). This means these files are never utilized when attempting to source map.
Assuming you wish to utilize the source map center instead of us downloading the files from your servers there are two fixes which need to be made.
Firstly the URLs of the files listed need to be updated to be the same as the URL by removing the "/script" from the middle of the URLs of your uploaded scripts.
Secondly you will either have to
- update your uploaded minified files to reference your map files by including a //# sourceMappingURL=... comment at the bottom when they are generated
- list your map files at the URL of the minified files in the source map center (this is a shortcut - specific to files within the source map center - which removes the need for uploading the minified files)
Let me know if you have any further questions. You can click the "feedback" button for private support.
Regards,
Alex
alexmac
Posted on
Nov 09 2016
Hi Alex, thanks for the help. The problem was in wrong path to scripts in the source map center.
Alex
Posted on
Nov 10 2016
No worries, glad you got things sorted!