Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Async errors break source maps (whether or not long-stack-trace is used) #701

Closed
brian428 opened this issue Mar 28, 2017 · 2 comments
Closed

Comments

@brian428
Copy link

I saw the existing issue related to long-stack-trace, but this happens whether or not long-stack-trace is being used. I'm using Angular 4.0.0 and Zone 0.8.5.

Inline TypeScript-generated source maps work fine in most situations, but if Zone catches an error during async processing (such as an RxJs subscribe handler), I get an error that isn't leveraging the source maps. E.g.:

zone.js:569 Unhandled Promise rejection: Cannot read property 'not' of undefined ; Zone: ProxyZone ; Task: Promise.then ; Value: TypeError: Cannot read property 'not' of undefined
    at eval (http://localhost:9876/base/dist/dev/app/charts/components/plotly/base-plotly-chart.component.js:92:62)
    at Array.forEach (native)
    at eval (http://localhost:9876/base/dist/dev/app/charts/components/plotly/base-plotly-chart.component.js:86:54)
    at Array.forEach (native)
    at eval (http://localhost:9876/base/dist/dev/app/charts/components/plotly/base-plotly-chart.component.js:82:47)
    at Array.forEach (native)
    ...etc...

Is this a bug with Zone? Or is this expected, and Zone currently just can't map the source of the error back to the TS file?

@brian428
Copy link
Author

Actually, trying out a number of things and it seems that this is actually a limitation of the way console logging of errors is done in Chrome.

@brian428
Copy link
Author

If anyone also runs into this, one option I uncovered that seems to work pretty well (at least in Chrome) is the NPM package source-map-support.

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

No branches or pull requests

1 participant