-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Closed
Copy link
Labels
Domain: ES ModulesThe issue relates to import/export style module behaviorThe issue relates to import/export style module behaviorDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Good issue if you're already used to contributing to the codebase. Harder than "good first issue".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
Found from an issue I was diagnosing for @mpodwysocki.
Today, if you use "module": "nodenext"
or "module": "node16"
, you might try to import from a package with ESM files and get the following error message
Module 'yadda/file.js' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.
This is extremely confusing. The fix is typically to add the following field to the package.json
that corresponds to the importing file with the error:
"type": "module"
lostpebble and adanski
Metadata
Metadata
Assignees
Labels
Domain: ES ModulesThe issue relates to import/export style module behaviorThe issue relates to import/export style module behaviorDomain: Error MessagesThe issue relates to error messagingThe issue relates to error messagingEffort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Good issue if you're already used to contributing to the codebase. Harder than "good first issue".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this