Skip to content

Debugging Web Apps: Stacktrace/Mapping seems broken #1525

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
nilsdoehring opened this issue Jun 6, 2018 · 11 comments
Closed

Debugging Web Apps: Stacktrace/Mapping seems broken #1525

nilsdoehring opened this issue Jun 6, 2018 · 11 comments

Comments

@nilsdoehring
Copy link

When debugging a web app that is producing cast errors at runtime, a user would expect that:

  • Debugger gets triggered, displaying the error message and Dart stack/code
  • Console prints meaningful info, or at least the same contents as Chrome dev tools console

What happens instead?

  • Debugger doesn't get triggered
  • Console prints only a subset of Chrome dev tools console (Screenshot 1)
  • User has to look at Chrome's console output and make best guesses where the error lies in Dart code (Screenshot 2)

What steps will reproduce the problem?

  1. Checkout this branch (it is missing a typecast when parsing json)
  2. Activate Dart, pub get
  3. Debug example/swords_man/index.html

Screenshot 1
image

Screenshot 2 (Chrome console)
image

IDEA EAP 2018.2
Dart SDK 2.0.0-dev.60.0
build_runner: ^0.8.9
build_test: ^0.10.2
build_web_compilers: ^0.4.0+3
OSX, Chrome

Also reported in Jetbrains YouTrack as WEB-33172

@eredo
Copy link

eredo commented Jun 6, 2018

Not sure if that's applicable to this log output, but there was a comment in a similar angular issue about turning on custom formatters for in Chrome Dev Tools: angulardart/angular#1367 (comment)

@jakemac53
Copy link
Contributor

@nilsdoehring can you confirm if enabling the custom formatter fixes this issue for you?

@afpatmin
Copy link

afpatmin commented Jun 15, 2018

Enabling it does not fix it for me unfortunately. When I ran it in Firefox, it output a warning in the console;

Source map error: request failed with status 404
Resource URL: http://localhost:8080/packages/$sdk/dev_compiler/amd/dart_sdk.js
Source Map URL: dart_sdk.js.map[Learn More]

@afpatmin
Copy link

Update; removing <base href="/"> in index.html made it reference dart files directly again on my end

@nilsdoehring
Copy link
Author

Enabling custom formatters indeed makes Chrome console reference the dart files (see pic below). No changes on the IDEA side, though (i.e. console output exactly the same as in OP).

image

@matanlurey
Copy link
Contributor

@natebosch Do you want to track IDE issues here or elsewhere?

@matanlurey matanlurey added the needs-info Additional information needed from the issue author label Jul 6, 2018
@natebosch
Copy link
Member

@jwren - where is the best place to track IntelliJ issues like this one?

@jwren
Copy link
Member

jwren commented Jul 6, 2018

In YouTrack, when @nilsdoehring opened the issue he included a link to https://youtrack.jetbrains.com/issue/WEB-33172

@natebosch
Copy link
Member

Sounds good, we'll track there. We can reopen this issue if we need any changes on the build side.

@natebosch natebosch removed the needs-info Additional information needed from the issue author label Jul 6, 2018
@jwren
Copy link
Member

jwren commented Jul 6, 2018

SGTM. Are we sure then that the source maps are all correct from the DDC side?

@natebosch
Copy link
Member

Are we sure then that the source maps are all correct from the DDC side?

I think we're confident with them. We have some tests for source maps and things seem to be working in the browser once the config is set up.

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

7 participants