We started using Sentry some time ago, and first, we did our PHP Integration. However, I’m currently looking into integrating the JS SDK. This has been done and we’re getting events/exceptions into sentry. The next logical step was to set up source maps. However, this is where I run into issues:
- Events are not being ‘decoded’ with the source maps and source files
- There are no ‘errors’ shown at the events, and there is no easy way in the WebUI to see why the source maps are not picked up (this would have been great)
- For example saying: “No map found”, “No source files present”, “No sourcesContent present” etc.
We build or JS with Google Closure Compiler, but it is compiled with Plovr. This does not gives us working sourcesContent. So we’re currently uploading the source maps with these commands in our CI (please note that variables work):
- VERSION=$(sentry releases propose-version) - sentry releases new --finalize -p $SENTRY_PROJECT_JS $VERSION - sentry releases set-commits --auto $VERSION - sentry releases files $VERSION upload-sourcemaps --rewrite --validate --url-prefix="~/js/" public/js/
> Analyzing 2116 sources > Rewriting sources > Adding source map references > Validating sources > Uploading source maps for release cd7cd1b434f3928e4f6808b9feb17a1b743f7d0a Source Map Upload Report Scripts [... report content here, more on that later on ...]
Most of the original source code and the source maps are in
public/js/ folder, we get some warnings because of extra JS files not being mapped etc (I suppose this should not be an issue). The files we’re using in production are being mapped:
~/js/minified/modules/cp/cp-vps.js (sourcemap at cp-vps.map) ~/js/minified/modules/some-internal-module/some-js-file-1.js (sourcemap at some-js-file-1.map) ~/js/minified/modules/some-internal-module/some-js-file-2.js (sourcemap at some-js-file-2.map) ~/js/minified/modules/some-internal-module/some-js-file-3.js (sourcemap at some-js-file-3.map) ~/js/minified/modules/some-internal-module/some-js-file-4.js (sourcemap at some-js-file-4.map)
Which should indicate that the file has a source map attached in Sentry. When inspecting the error I also see the following:
Error_.e.Cz(js/minified/modules/some-internal-module/some-js-file-1.js (which would indicate that the URLS are also match)
However, We’re getting these warnings (so no indication of an Error):
~/js/minified/modules/some-internal-module/some-js-file-1.js - warning: missing sourcecode (~/js/lib/closure/goog/mochikit/async/deferredlist.js) - warning: missing sourcecode (~/js/lib/closure/goog/mochikit/async/deferred.js) ~/js/minified/modules/some-internal-module/some-js-file-2.js - warning: missing sourcecode ( [synthetic:1] ) ~/js/minified/modules/some-internal-module/some-js-file-3.js ~/~/js/minified/modules/some-internal-module/some-js-file-4.js - warning: missing sourcecode ( [synthetic:1] ) - warning: missing sourcecode ( [synthetic:es6/util/arrayiterator] ) - warning: missing sourcecode ( [synthetic:es6/util/makeiterator] ) - warning: missing sourcecode (~/js/lib/closure/goog/mochikit/async/deferred.js)
My question and last guess is that source maps are not being picked up because of these warnings. I can probably fix those missing JS files.
However, I’m also not sure how the source map decodation handles the
synthetic:es6/util/makeiterator ‘sources’ which seems to be references to ‘native code’
Thanks for your help, and I hope this would give you enough info.