The Opbeat Node.js agent supports source maps by default. If your transpile your source code and suppply a source map, Opbeat will be able to show you correct stack traces and even the original source code if available.
To take advantage of this, simply make sure that your transpiled source
code contains a
sourceMappingURL comment at the bottom of each
Or you can inline the source map using base64 encoding:
All modern build-toolchains support generating source maps and adding these comments to the transpiled source code.
Opbeat uses source maps for two things: Showing you stack traces that point to your original source code and showing you the original source code as inline code snippets related to each frame in your stack traces.
For optimal support, we recommend that you either inline the original
source code using the
sourcesContent property inside the source map,
or that you deploy the original source code to your production server
along with the transpiled source code.
If you choose to deploy the original source code, make sure that it’s
accessible via the file-system at path specified with the
property in the source map.
Your source maps or original source code does not need to be available via the internet. Everything is handled by the local Opbeat agent on your server.