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
Currently, ESBuild uses TypeScript's paths compiler option to resolve source files which can lead to problems if the said option is only used to fix typing-related issues. That's because in those cases the destination paths will be .d.ts files which either result in parsing issues or the package not being imported (because the file is handled like an empty file).
Reproduction
The issue can be reproduced by cloning this repo, installing the dependencies, and then running the bundle and bundle:paths scripts. Right now the latter will fail because this fix isn't released yet. Once it is released it will no longer fail, but produce incorrect output as the bundle will no longer include the imported package (just void 0).
Possible fix
This could be fixed by ignoring all types entries ending in .d.ts as developers will never expect those to actually resolve to a source file at build time.
Based on #2070 (comment)
Currently, ESBuild uses TypeScript's
paths
compiler option to resolve source files which can lead to problems if the said option is only used to fix typing-related issues. That's because in those cases the destination paths will be.d.ts
files which either result in parsing issues or the package not being imported (because the file is handled like an empty file).Reproduction
The issue can be reproduced by cloning this repo, installing the dependencies, and then running the
bundle
andbundle:paths
scripts. Right now the latter will fail because this fix isn't released yet. Once it is released it will no longer fail, but produce incorrect output as the bundle will no longer include the imported package (justvoid 0
).Possible fix
This could be fixed by ignoring all
types
entries ending in.d.ts
as developers will never expect those to actually resolve to a source file at build time./cc @magic-akari
The text was updated successfully, but these errors were encountered: