-
Notifications
You must be signed in to change notification settings - Fork 583
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
sourceMap issues #2109
Comments
@guybedford do you know for sure this is only for |
Yes it does seem like it is a little more general actually, I'm still working on refining the exact edge cases. Currently what I have is that: export function f() {
return 'asdf';
}
f(); works fine, while: export async function f() {
return 'asdf';
}
f(); suddenly seems to invalidate the source map. Still investigating exactly what these edge cases are to report back further. |
This does seem to be a general issue. I can recreate it in the following cases:
import _classCallCheck from 'npm:[email protected]/babel-helpers/classCallCheck.js';
export function asdf() {
return 'hello world';
}
asdf([1, 2].concat([]));
export var p = function p() {
_classCallCheck(this, p);
console.log('hello world');
};
new p(); |
So yes this is not related to inputSourceMap actually at all. Also I have a few custom transformers that all work fine. It seems that it is larger code position changes in the instantiate that cause issues here somehow. I haven't checked if it affects other transformers besides the instantiate transformer. |
If we can reproduce this w/o modules it is a lot easier to debug. When I try this case: and use Options > SourceMaps the ranges are shown on the repl. The lines look correct but the columns are off. Is this what you are seeing? How would you describe the problem? |
I investigated your case without instantiate and I see some problems with column offsets and with the beginning and end of files (export keyword). But debuggers mostly work on lines so I don't think this explains any significant issue. I guess I need to figure out how to dynamically compile with |
It seems that the
inputSourceMap
feature may been broken at some point in the last few releases. I'm still working on isolating the exact behaviour, but it seems that the offsets output an invalid source map when using the inputSourceMap (although it can be tricky to catch as the offset issues only arise on larger transpilations from what I've seen).I will see if I can provide more info soon on this, just to put a placeholder here for now. If there are any ideas what might have caused this do let me know too.
Tracking from systemjs/builder#542.
The text was updated successfully, but these errors were encountered: