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

Errors are not readable / prevent sourcemaps in console because of Zone.js #15185

Closed
tbosch opened this issue Mar 15, 2017 · 9 comments
Closed

Comments

@tbosch
Copy link
Contributor

tbosch commented Mar 15, 2017

Zone.js replaces the global Error function.
This breaks logging of errors:

  • if a user calls new Error(...), the error is shown as an object instead of showing its stack
  • for SyntaxErrors, stack traces don't work correctly with sourcemaps.
  • source maps don't work on stack traces when long-strack-trace zones is used
@tbosch tbosch added this to the 4.0.0-blockers milestone Mar 15, 2017
@tbosch
Copy link
Contributor Author

tbosch commented Mar 15, 2017

for the long stack traces issue, see angular/zone.js#661

@tbosch
Copy link
Contributor Author

tbosch commented Mar 16, 2017

This is still not working...
See cl/150369238 for a reproduction...

@Martin-Luft
Copy link

Martin-Luft commented Mar 17, 2017

I don't know if this is related... When I use require('zone.js/dist/long-stack-trace-zone'); then I get this console output (version 0.8.4):

long-stack-trace-zone.js?fcc3:149 >>>>>>  Error: STACKTRACE TRACKING
long-stack-trace-zone.js?fcc3:149 >>>>>>     at __SEP_TAG__ (eval at <anonymous> (http://localhost:8080/polyfills.js:3091:1), <anonymous>:128:37) [<root>]     at captureStackTraces (eval at <anonymous> (http://localhost:8080/polyfills.js:3091:1), <anonymous>:128:37) [<root>]

SamVerschueren pushed a commit to SamVerschueren/angular that referenced this issue Mar 18, 2017
@cdupetit
Copy link

@Martin-Wegner Same console output for me (zone.js: 0.8.4) :

long-stack-trace-zone.js:149 >>>>>>  Error: STACKTRACE TRACKING
long-stack-trace-zone.js:149 >>>>>>     at __SEP_TAG__.54 (http://10.3.60.13:3000/index.js:1122:1) [<root>]     at Object.54 (http://10.3.60.13:3000/index.js:1122:1) [<root>]
long-stack-trace-zone.js:149 >>>>>>     at __SEP_TAG__.54 (http://10.3.60.13:3000/index.js:1122:1) [<root>]     at eval (webpack:///./src/polyfills.browser.ts?:9:93) [<root>]

my polyfills.browser.ts:

import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'core-js/client/shim';
import 'zone.js/dist/zone';
import 'zone.js/dist/long-stack-trace-zone';
import 'ts-helpers';

@tbosch
Copy link
Contributor Author

tbosch commented Mar 20, 2017

Note: This is already fixed in angular/zone.js@6010557 and will be released soon.

@PostImpatica
Copy link

I'm still getting @Martin-Wegner's issue even after installing 0.8.8. Anyone else?

@shwedberlin
Copy link

Just installed 0.8.12 - still getting this in VS console

@sebastianrothbucher
Copy link

a hint (I think it was mentioned above): including

npm install source-map-support --save-dev

and

import 'source-map-support/register';

into the root test.ts gets back the mapped exceptions. Did not check deeply for side effects - but maybe that helps already

asnowwolf pushed a commit to asnowwolf/angular that referenced this issue Aug 11, 2017
asnowwolf pushed a commit to asnowwolf/angular that referenced this issue Aug 11, 2017
juleskremer pushed a commit to juleskremer/angular that referenced this issue Aug 28, 2017
juleskremer pushed a commit to juleskremer/angular that referenced this issue Aug 28, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants