-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Function arguments do not match local inspect options #2076
Comments
Sounds like your request is actually about the transpiled code, but if you're using source-maps, then yes #1296 fixes it:
|
Thanks @privatenumber I didn't know about that replication system. We're seeing bugs in the sourcemap name and that looks like the perfect place to replicate (and then I'll report here / in a new issue). |
This continues to be an issue:
(Noting that noting in 0.15.11 and 0.15.12 related to this) @evanw in case the issue was unclear before here's what it looks like in practice: |
I think what you're describing is more of a limitation with Chrome's console not being able to map variables to the ones in the source map: |
I'm closing this issue because this is a known limitation of source maps, and I don't want to expand esbuild's scope to try to add hacks like this to the generated code to try to improve debugger support. The source maps that esbuild generates now include |
Thanks @evanw . For ease of reference / future readers, this has been a bug/omission in Chromium for what looks to be around 7 years, but looks to be down to only one blocker. [1] There doesn't seem to be an issue for Bugzilla / Mozilla, that I could find. [2] [1] https://bugs.chromium.org/p/chromium/issues/detail?id=327092 |
It seems that in some circumstances function arguments use the global variable names. For example:
I presume the reproduction/cause is trivial here, but I can elaborate if needed.
This exhibits as a problem when debugging. Specifically, if one tries to access
r
or add breakpoints/logpoint based onr
it'll use the global, rather than the local function argument. This is not the expected/desirable behaviour. The workaround is for developers to look into theScope => Local
in DevTools to see what the variable actually is named, which is not obvious/intuitive and adds cycles.It would be better if the transpiled output honoured the function argument names. For example:
There are other options e.g.
g.r
g_r
for the globalThank you, esbuild is looking amazing!
The text was updated successfully, but these errors were encountered: