-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Issues with source maps #18050
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
Comments
This comment was originally written by [email protected] Yes, with Dart Editor version 1.3.0.dev_07_10 (DEV) & Dart SDK version 1.3.0-dev.7.10 the source map is linked and the console error message refers to js_helper.dart:1187. But this is still not the correct place in the original code!.. |
cc @munificent. |
This is definitely not a pub issue. The source map exists and is being read by the browser; it's just not directing to the location the user expects. Removed Area-Pub, Pub-Build labels. |
This definitely will not work on 1.2 stable. Like you note, the source map reference is missing and the paths are wrong. It should work on the latest 1.3 dev builds. This may be a pub issue. Pub has a lot of control over what paths dart2js thinks it's using to find the SDK. Can you give me a very precise set of steps to repro? Ideally, a .zip of a package I can try this on, but if it's simple enough just write it out here. What I want to know in particular is how the files in your package are organized. That will help me track down what's going on here. Thanks! Set owner to @munificent. |
This comment was originally written by [email protected] Here's the zipped project folder. Attachment: |
Added Started label. |
Ah, OK. Now I have a clearer picture of what's going on. Sorry, I didn't read your initial report correctly. I thought it couldn't find js_helper.dart. Your issue is that the source map is working, it just doesn't point to the code you want. This is indeed a dart2js issue. Pub is taking you to the file that the source map says it should. It's just that thrown exceptions seem to point to an unhelpful location. Removed Area-Pub label. |
Set owner to @johnniwinther. |
Note this is still an issue. This is likely related to having holes in the source-map. Johnni, here are two simple tests to make this easier to reproduce. Test 1: adapted from the original one. a.html: <body><script src=out.js defer></script> input.dart: import 'dart:html';
void main() {
new DivElement()
..onClick.listen(reverseText)
..click();
}
void reverseText(MouseEvent event) {
throw new Exception('boom!');
} The stack trace looks like:
The relevant output looks like this: 2984: reverseText: function($event) {
2985: throw H.wrapException(P.Exception_Exception("boom!")); Note that there are no columns on the stack trace. We don't seem to have entries for most of the body of reverseText. If I request column '2985:51' we do find the reverseText location, but we don't if I ask for '2985:0' or '2985:7' (where the throws is) Test 2: simplified even further to only use streams and no dart:html. This reproduces the problem in d8: import 'dart:async';
void main() {
new Stream.fromFuture(new Future(() {})).listen(boom);
}
void boom(_) {
throw new Exception('boom!');
} The stack trace is:
Using the backwards lookup, we get this:
|
This issue was originally filed by [email protected]
What steps will reproduce the problem?
When the error occurs, the console reports it with a reference to debug.dart.js:2791
So I looked inside the build\web directory of the project and saw, that the generated JS files (debug.dart.precompiled.js and debug.dart.js) had no link to the source map file (debug.dart.js.map). So:
Now the console referrs to some strange js_helper.dart:1081
This doesn't seem right! I expect a reference to the place in the original code = "throw new Exception('boom!');" in the reverseText method.
What version of the product are you using? On what operating system?
Can someone reproduce/confirm the issue or tell me what am I doing wrong?
The text was updated successfully, but these errors were encountered: