-
-
Notifications
You must be signed in to change notification settings - Fork 35.1k
Open
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.
Description
- Version: v14.11.0
- Platform: Win10 64bit
- Subsystem: internal/modules/esm/translators.js:117:18
What steps will reproduce the bug?
While other async operations are happening, load a malformed ES module
How often does it reproduce? Is there a required condition?
Consistently, in an ES module project, it seems to appear with lots of async operations including some that are using sockets.
What is the expected behavior?
Error: unexpected character at ...
What do you see instead?
(node:26584) UnhandledPromiseRejectionWarning: SyntaxError: Missing initializer in destructuring declaration
at Loader.moduleStrategy (internal/modules/esm/translators.js:117:18)
at Loader.moduleStrategy (internal/modules/esm/translators.js:117:18)
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)Additional information
Easy recreation:
// Malformed Module testImport.js
const {
general: { getLocal },
} from '#utils');
// imported asynchronously
import('./testImport.js').catch(err => console.log(err))Results in
SyntaxError: Missing initializer in destructuring declaration
at Loader.moduleStrategy (internal/modules/esm/translators.js:117:18)
at async link (internal/modules/esm/module_job.js:42:21)In which there's no helpful information about the locations/modules involved
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.