Skip to content

SourceMaps not working in error stacktrace #1457

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

Closed
paulsonnenschein opened this issue May 17, 2018 · 12 comments
Closed

SourceMaps not working in error stacktrace #1457

paulsonnenschein opened this issue May 17, 2018 · 12 comments
Labels
needs-info Additional information needed from the issue author

Comments

@paulsonnenschein
Copy link

After upgrading from an older version of Angular 5 alpha / Dart 2 dev releases to the latest one, im not getting source-mapped file paths in my error stack traces (notice the app_component.ddc.js 112:17 ngOnInit):

image

But the funny thing is, everywhere else the sourcemaps are working. For example in the Sources Devtools Tab and even in the underlying stack trace of the console message:

image

These are my specs:

Dart: Dart VM version: 2.0.0-dev.55.0 (Mon May 14 09:23:07 2018 +0200) on "macos_x64"
Build packages:

build 0.12.6
build_config 0.2.6+2
build_modules 0.2.2+4
build_resolvers 0.2.0+2
build_runner 0.8.9
build_test 0.10.2+3
build_web_compilers 0.4.0+1
built_collection 3.1.1
built_value 5.4.4

Angular: 5.0.0-alpha+11
Im on MacOS and using Chrome

@jakemac53
Copy link
Contributor

I don't quite understand the exact difference to reproduce these two different stack traces, what are the scenarios in which each one is generated? Can you give a minimal repro?

@paulsonnenschein
Copy link
Author

They are from the same error. The first screenshot is the content of the console error that angular (?) prints out. The second screenshot is chromes stacktrace of the console error (you see it when you click the grey triangle in the top left of a console error).

That means that chrome understands the sourcemaps (they also work in the sources panel), but the dart component that prints out the error string (containig the "bad" stacktrace from the first screenshot) does not.

@jakemac53
Copy link
Contributor

Ok, this does look like its coming from the angular specific ExceptionHandler class which is doing custom logging around stack traces.

@vsmenon was saying he expects the normal toString for stack traces to just do the right thing though.

@matanlurey any ideas here?

@jakemac53
Copy link
Contributor

Oh one thing @cookiecavekeeper it does look like there is an issue where stack traces don't work if you throw a String specifically, is that what you were throwing? If so can you try throwing a StateError or something like that?

Also can you please attach a minimal repro project so I can test it locally?

@paulsonnenschein
Copy link
Author

I threw a StateError and got the same result. But it seems its rather specific to my project, since I'm having a hard time reproducing it. But ill keep trying

@matanlurey matanlurey added the needs-info Additional information needed from the issue author label May 17, 2018
@matanlurey
Copy link
Contributor

@jakemac53 Nothing on the top of my head, except that some stack traces naturally propagate to the console and others are via window.console.error('$stackTrace').

@paulsonnenschein
Copy link
Author

@jakemac53 Alright, I reduced the project to just a couple of files that still give me the bug:

https://github.com/cookiecavekeeper/angular_dart_stacktraces_bug

@afpatmin
Copy link

I have the same issue with my project running on dart sdk 2.0.0-dev.55.0 on linux

@afpatmin
Copy link

I tested with and without hashLocationStrategy (long shot) on sdk dev.58.0, still not working for me

@jakemac53
Copy link
Contributor

I was able to repro this using the example, but the issue wasn't obvious. Currently working full steam ahead on making things Dart2 compatible, and after that I will take another look here.

@jakemac53
Copy link
Contributor

I believe that angulardart/angular#1367 will fix this issue? @matanlurey does that sound right?

@matanlurey
Copy link
Contributor

Yes. Lets close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Additional information needed from the issue author
Projects
None yet
Development

No branches or pull requests

4 participants