Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token < in JSON at position 0 #68

Open
ernsheong opened this issue Jun 8, 2019 · 3 comments
Open

Unexpected token < in JSON at position 0 #68

ernsheong opened this issue Jun 8, 2019 · 3 comments

Comments

@ernsheong
Copy link

image

I have a bug in production (3rd error), the surrounding first 2 and latter 2 are mysterious to me. Can anyone explain further?

@bz2
Copy link
Contributor

bz2 commented Jun 11, 2019

See upstream merge proposal stacktracejs/stacktrace-gps#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.

@ernsheong
Copy link
Author

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.

@bz2
Copy link
Contributor

bz2 commented Jun 11, 2019

That's fair enough, and see #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants