stackdriver-errors-js
stackdriver-errors-js copied to clipboard
Unexpected token < in JSON at position 0

I have a bug in production (3rd error), the surrounding first 2 and latter 2 are mysterious to me. Can anyone explain further?
See upstream merge proposal https://github.com/stacktracejs/stacktrace-gps/pull/57 which may not be the right fix, but is this issue.
In short, your source map is not valid JSON for some reason. Probably the error should be handleable at the stackdriver-errors-js level, but at the moment is not propagated up.
Thanks. The panaroid developer in me decided not to expose sourcemaps for fear of losing IP. Let me know if that shouldn't be a cause of concern... I think protection mechanisms for sourcemaps are still clunky.
So perhaps sourcemaps should be made optional. Bonus points if sourcemaps can be exposed only to Stackdriver, done securely.
That's fair enough, and see https://github.com/GoogleCloudPlatform/stackdriver-errors-js/issues/4 for supporting private sourcemaps. If you're scrubbing sourcemaps for prod deploy though, you should also scrub the url reference from the bottom of the source files to avoid this bug.