Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 13.8k
Support Node Package Subpath Pattern Imports #44848
Copy link
Copy link
Closed
Labels
Domain: ES ModulesThe issue relates to import/export style module behaviorThe issue relates to import/export style module behaviorNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
Metadata
Metadata
Assignees
Labels
Domain: ES ModulesThe issue relates to import/export style module behaviorThe issue relates to import/export style module behaviorNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Bug Report
Typescript ignores Package Subpath Imports breaking the linter when using a loader. These "aliases" are not optional when you have multiple entry points or executables at different levels.
Related to #33079
Making a new bug as the conversation there is about exports... but the import side is also important and has a seperate set of solutions.
🔎 Search Terms
Module alias, import patterns, pwd, es modules, node
🕗 Version & Regression Information
Please keep and fill in the line that best applies:
⏯ Playground Link
Running node 16 with ts-node loader in a native ES Module package.
Coming soon from runkit. Integration issues like this are tricky. But I've got the tools to make it so.
💻 Code
🙁 Actual behavior
"Cannot find module '#src/models/mongodb.js' or its corresponding type declarations.ts(2307)"
🙂 Expected behavior
Should work like regular javascript.