-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
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.
Description
- Version: v13.2.0
- Platform: Windows 10, 64-bit
- Subsystem: N/A
When trying to import a JSON file, the error message provided is the following:
(node:7004) ExperimentalWarning: The ESM module loader is experimental.
internal/modules/run_main.js:50
internalBinding('errors').triggerUncaughtException(
^
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension: C:\Users\Mercy\Desktop\New folder\node_modules\patron.js\package.json
at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:114:13)
at Loader.resolve (internal/modules/esm/loader.js:74:33)
at Loader.getModuleJob (internal/modules/esm/loader.js:148:40)
at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:41:40)
at link (internal/modules/esm/module_job.js:40:36) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
How to reproduce:
- Create test.mjs with
import './package.json'
- Run
node test.mjs
To 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
.
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.