-
-
Notifications
You must be signed in to change notification settings - Fork 14
Identifier source mapping incorrect #7
Identifier source mapping incorrect #7
Comments
FYI @privatenumber it seems this issue is in fact with esbuild evanw/esbuild#1296 (comment). Id say it'd be good for now to turn off identifier minification to allow for proper debugging. Happy to put up a pr if you like. |
Thanks for the report! Do you mind providing a quick reproduction (inline code snippets is fine)? I'd like to investigate the problem. |
@privatenumber if you create a file with any identifiers and run it with a debugger it will not let you hover over and inspect those identifiers. Eg
const abc = 1;
debugger;
console.log(abc); Then running Here you can see the variable got minified to But if I manually change the minify options in my |
Again the issue is technically with esbuild, but w/o the workaround here it makes debugging harder. |
I'm OK with swapping I'm looking to add a small test to test against this behavior though and I can't think of one. I am using Do you have any ideas? |
@privatenumber the best I can come up with is to test against an error that includes the identifier name in the message, eg assignment before initialization like this:
(() => abc = 1)();
let abc;
Yields
Removing the
|
This comment was marked as off-topic.
This comment was marked as off-topic.
@DylanPiercey Thanks! @AisonSu I'll create a contributing guide later to explain how to set these up without a mono repo and why I didn't choose a mono repo. |
FYI I'm considering re-enabling this now that esbuild supports names via evanw/esbuild#1296 |
👍 |
When debugging a typescript file the identifiers do not seem to be mapping back correctly.
Disabling esbuilds minification (https://github.com/esbuild-kit/core-utils/blob/develop/src/esbuild/index.ts#L32) resolves the issue for me.
This is possibly an esbuild issue, but I wonder if it makes sense to turn off minification here for now, or maybe just to use the
minifyWhitespace: true
option instead which also works fine.The text was updated successfully, but these errors were encountered: