-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
esm: invalid extension error should provide parent context in error #30721
Copy link
Copy link
Closed
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.Issues that need assistance from volunteers or PRs that need help to proceed.
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.Issues that need assistance from volunteers or PRs that need help to proceed.
When trying to import a JSON file, the error message provided is the following:
How to reproduce:
import './package.json'node test.mjsTo help debug this error we should ensure it provides the name of the parent module that attempted the file extension load - something like
imported from /path/to/test.mjs.