You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Jonas Brems, Paul A.T. Wilson, Anton Fandul, Grzegorz Judas, RayzRazko, Taylor Thurlow, Taylor Knapp, Daniel Singer, Borja Esteban, Sarah and 3 more
So I just configured debugging in VSCode and was really amazed by how great it works... until I noticed the variable names that is. Came here after research on why, when I put a breakpoint I see the transpiled variable names instead of the original ones, even though I have the source maps working. I can't use the original names in the debug console either, which breaks the whole experience.
I'd say it's a pretty important, but I have no concept on how complex it is to implement, so I'll just leave it here in hope it'll increase the priority.
Reacted by Peter Todd, mangogan-git, Aaron Junot, Alex Tokarev, Maarten Vercruysse and Maria
Also without the knowledge about the current implications of fixing this, but the reality is that this breaks 25% of typescript debugging on IntelliJ IDEA, VS Code, etc, whenever you need to evaluate code with imported symbols.
This is extremely frustrating. Sometimes it makes it almost impossible to debug the code. I'm surprised this issue is not prioritized.
Reacted by Francesco Borzì, marc j. schmidt, snowfa, Taylor Thurlow, Pavel Luhin, Michael Sewell, Georgy Farniev, Piotr Oleś, Daniel Singer, Cássio Seffrin and 14 more
Alos having this issue. I am unable to implement Webpack into my project to work around this bug. This seems like it shouldn't be too complicated to fix / implement, am I being too naive?
At least, can you give me a brief insight how difficult will it be to solve in case if I will try to create PR for this issue?
Wish you to have a nice weekend.
Reacted by 粥加米, songkeys, Rick Bartlett, Karan Shah, Shaun Pedicini, stan, Alex Tokarev, Maarten Vercruysse, Gabriel Zimmermann, Zachary (Zac) Pustejovsky and 1 more
2022, any updates on this? Best practices in terms of getting this working without being forced to use webpack in webstorm? I use parcel, is it possible to get this working using that bundler?
I hit this issue today, and got it working by using tsup/esbuild
Importantly, treeshake had to be set to false, or variables would all be undefined again.
It's either that or typescript will need to add the original names[] and their associated mappings: "..." in to the source map.
I'm guessing the source map update would most likely need to be put somewhere here?
Going to take someone with good experience of the typescript source code to fix this.
Activity
mhegazy commentedon Jul 11, 2016
this is not a supported feature at the moment. the compiler does not emit names to the source map output.
nojvek commentedon Jan 23, 2018
Is this something that is relatively easy to fix as part of sourcemap emit step ?
yudhistira-arya commentedon Jan 23, 2020
Is this issue still being actively looked at?
grzegorzjudas commentedon Apr 24, 2020
So I just configured debugging in VSCode and was really amazed by how great it works... until I noticed the variable names that is. Came here after research on why, when I put a breakpoint I see the transpiled variable names instead of the original ones, even though I have the source maps working. I can't use the original names in the debug console either, which breaks the whole experience.
I'd say it's a pretty important, but I have no concept on how complex it is to implement, so I'll just leave it here in hope it'll increase the priority.
axelcostaspena commentedon May 26, 2020
Also without the knowledge about the current implications of fixing this, but the reality is that this breaks 25% of typescript debugging on IntelliJ IDEA, VS Code, etc, whenever you need to evaluate code with imported symbols.
https://youtrack.jetbrains.com/issue/WEB-43973
https://stackoverflow.com/questions/59864978/typescript-undefined-constant-during-debugging-session
RayzRazko commentedon Jun 6, 2020
This is extremely frustrating. Sometimes it makes it almost impossible to debug the code. I'm surprised this issue is not prioritized.
FrancescoBorzi commentedon Jun 12, 2020
Confirmed. This is extremely important.
Yehonal commentedon Jun 12, 2020
I ended-up here from this stackoverflow issue:
https://stackoverflow.com/questions/56669155/debugging-vs-code-with-typescript-shows-transpiled-variable-names-instead-of-rea
I literally cannot debug my typescript node application because exported variables are not recognized by the debugger.
And this issue exists since 2016! How could it be?
That's the evidence:
8 remaining items
BenMoses commentedon Mar 3, 2021
Alos having this issue. I am unable to implement Webpack into my project to work around this bug. This seems like it shouldn't be too complicated to fix / implement, am I being too naive?
Christilut commentedon Mar 21, 2021
Same problem here. Very hard to use the debug console.
As a (painful) workaround, you can see what actual variable names you should use in the debugger, eg instead of
Foo.bar()it might be_Foo.Foo.bar()pavel-luhin commentedon Apr 1, 2021
Notice same issue. Global config variables almost always undefined in debugger, and cannot ‘Evaluate Expression’ in WebStorm IDE.
bingtimren commentedon Jun 23, 2021
Same issue. This makes debugging with IDE awful. Wish there's a solution to this.
vkria-sftsrv commentedon Jul 23, 2021
Same issue. It causes
ReferenceError: <var> is not definedin WebStorm in Evaluate Expression window...georgyfarniev commentedon Sep 18, 2021
Ryan Cavanaugh (@RyanCavanaugh) Wesley Wigham (@weswigham) Alan Agius (@alan-agius4) hello, is there any plans to include this issue in the roadmap? I also find it extremely frustrating.
At least, can you give me a brief insight how difficult will it be to solve in case if I will try to create PR for this issue?
Wish you to have a nice weekend.
scpedicini commentedon May 22, 2022
2022, any updates on this? Best practices in terms of getting this working without being forced to use webpack in webstorm? I use parcel, is it possible to get this working using that bundler?
imfycc commentedon May 22, 2022
spyro2000 commentedon Mar 13, 2023
It's been 7 years now.
SEVEN.
YEARS.
And it's still not possible to debug/evaluate an imported function in typescript. I just can't believe this has never been fixed. It's just broken. :(
segevfiner commentedon Mar 13, 2023
I think esbuild does output the names array, you can try using it instead of tsc, or use it via tsup.
espenja commentedon Oct 27, 2023
I hit this issue today, and got it working by using
tsup/esbuildImportantly,
treeshakehad to be set tofalse, or variables would all beundefinedagain.Here's the
tsupconfig I ended up with:pflannery commentedon Jun 13, 2024
I have this issue too. Im using version 5.4.5. It only happens to me when compiling from esm to cjs.
Esm named imports get wrapped into a generated object (here) which then causes issues with debugging the original source code.
Example:
One workaround is to use
import * as {alias}e.g.
But this isn't ideal and limits esm import features.
It would be great if typescript could output a left-hand object destructor (when the target supports destructoring)
It's either that or typescript will need to add the original
names[]and their associatedmappings: "..."in to the source map.I'm guessing the source map update would most likely need to be put somewhere here?
Going to take someone with good experience of the typescript source code to fix this.
matthewdowell commentedon Mar 21, 2025
Please let there be some traction on this. Such a painful debugging experience 😔. I really don't want to switch IDE's but might have to.
bingtimren commentedon Mar 21, 2025
Lately I have been using Javascript Debug Terminal and TSX, zero setup and just works.