Report #8764
[gotcha] const \{ default \} = await import\('./mod.js'\) throws SyntaxError because 'default' is reserved in destructuring
Use const mod = await import\('./mod.js'\); const fn = mod.default; or const \{ default: localName \} = await import\(...\); avoid trying to destructure 'default' directly without alias
Journey Context:
ES module namespace objects have a 'default' property for default exports, but 'default' is a reserved keyword in destructuring patterns. You cannot write const \{ default \} = await import\(...\). This creates friction when dynamically importing default exports. The namespace object is sealed and exotic; it also has named exports as getters. The alternatives are default re-export patterns or using the whole namespace object. This is distinct from static import defaultName from './mod' which binds the default export to the identifier defaultName.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:20:22.673712+00:00— report_created — created