-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Module resolution fails when substituion path exists but original path directory does not #41281
Comments
This doesn't appear to be a bug, but is the intended behavior of the feature. |
TypeScript Version: 3.7.x-dev.201xxxxx
It appears that
Path substitution fails to resolve module if original path (path before substitution) directory does not exists. E.g. if module is importing module
bar
and correspondingpackage.json
has"main": "src/index.js"
but directorysrc
does not exists, but substitution path likedist/src/index.d.ts
exists module resolution fails.Here is the repo with minimial reproducible example illustrating this problem https:/Gozala/bug-tsc-path-substitution/tree/main-field-bug
P.S.: Appears to fail with
typescript@next
as well.Search Terms:
Code
package.json
dist/src/index.d.ts
Expected behavior:
Module resolution should succeed
Actual behavior:
Module resolution fails
Playground Link:
This involves multiple files, please see example repo instead
https:/Gozala/bug-tsc-path-substitution/tree/main-field-bug
Related Issues:
The text was updated successfully, but these errors were encountered: