You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ee4a8d3
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(module)!: reject missing bare import() specifiers instead of placeholding
The optional-module placeholder now serves the require() path only.
ESM has a standards answer that CommonJS lacks — a dynamic-import failure
is a catchable rejection, so 'try { await import(x) } catch {}' covers
optional dependencies at the call site — and in a dev session a bare
specifier the import map doesn't cover is a configuration bug that the
placeholder was converting into a lazily-throwing proxy instead of a
loud resolver failure.
IsLikelyOptionalModule loses its header declaration and becomes static
to ModuleInternal.mm with its require()-only role documented. The specs
in NodeBuiltinsAndOptionalModulesTests.mjs pin the new contract: any
missing bare specifier rejects with 'Cannot find module', package-shaped
or not. The require()-side restore stays pending review, per
docs/knowledge/optional-module-placeholder.md.
If real-world dev-session testing surfaces a case that genuinely needs
the import()-side placeholder (a static import of an optional package in
a file-based ESM app), this commit is the isolated revert target.
0 commit comments