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
// @filename: definition.tsfunctionX(){}typeX=true;exportdefaultX;// do "find references" here// @filename: usage.tsimportXfrom'./definition';X;// this reference is foundasyncfunctionasd(){consta=awaitimport('./definition');a.default;// this one is notawaitimport('./definition').then((m)=>m.default/* this one is not */);}
π Actual behavior
This needs the files to be copied into your IDE to reproduce. In VS Code, do "find references" on export default X. You'll see that the references of the indirect export (e.g. function x()...; export default x instead of export default function x()...) are not recognized for dynamic imports (for static imports they are).
π Expected behavior
Recognize references for dynamic imports, too
Additional information about the issue
The playground needs to be copied into real files locally, as the playground isn't multifile-capable (from what I know), but it's needed for this reproduction.
Doing indirect exports is sometimes necessary in order to do declaration merging.
The text was updated successfully, but these errors were encountered:
You can do multi-file repros in the bug workbench. See here. From the given information it isn't entirely obvious to me where do you request references and which ones are missing.
π Search Terms
references dynamic import
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/dev/bug-workbench/?ts=5.8.2#code/PTAEAEDMEsBsFMB2BDAtvAXKAJvGjoAXaAe0QDpCBnAWAChIBXRAY2LNAA0AKASlADeAX3qEAngAd4XUAF5QhAE6N4AbnrwAHhJKLCOPMkax9nVaBA4SoAET5soRXnhPW8KjdAALF-Hr+6Syg4JDRMUEYqZABzeEpaOmhUHT0ZSEUSVFAAcnJgXHwiUkRs9Tp6MwswQi9oKkdnVxZpOtBIEmZsAOQqMVY25jZi0B7sPkF6AEgWMip9ZDkRgHdkIlAklMJuXPy8aAJ2Et4yyeRyAqMTc0sa1rIW+sQSQinkFbWN3S2dgv2ismyvEoPkQ3G4qH4sgAfKBUOdDMZ9MAAFQKWr1e7rR7PUDI4DHUD0ER0IA
π» Code
π Actual behavior
This needs the files to be copied into your IDE to reproduce. In VS Code, do "find references" on
export default X
. You'll see that the references of the indirect export (e.g.function x()...; export default x
instead ofexport default function x()...
) are not recognized for dynamic imports (for static imports they are).π Expected behavior
Recognize references for dynamic imports, too
Additional information about the issue
The playground needs to be copied into real files locally, as the playground isn't multifile-capable (from what I know), but it's needed for this reproduction.
Doing indirect exports is sometimes necessary in order to do declaration merging.
The text was updated successfully, but these errors were encountered: