-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.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
As reported by @coreyfarrell here -
Interesting note, the following code executed by CJS does not produce any warning or error in node.js 13.2.0:
import('./nyc.config.mjs')
.then(console.log)
.catch(e => console.error(e.message));When using dynamic import the experimental modules implementation is effectively used "lazily". Even when loaded at this point the warning should still be displayed.
Currently the warning is implemented at https://github.com/nodejs/node/blob/master/lib/internal/process/esm_loader.js#L45.
When calling the first dynamic import through https://github.com/nodejs/node/blob/master/lib/internal/process/esm_loader.js#L26 we should also be able to ensure the warning is provided.
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.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.