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
ESM specifier resolution flag does not use useESMLoader for entry point #35095
The ES module specifier flag should use the esm loader to load extensionless entrypoints as esm modules. I believe the es-module-specifier-resolution option was deprecated in v13.4.0, but the esm loader is still using that option to specify the resolver: https://github.com/nodejs/node/blob/master/lib/internal/modules/run_main.js#L28
Version: 14.7.0
Platform: openSUSE Tumbleweed
Subsystem: ESM Loader
What steps will reproduce the bug?
mkdir test-dir
cd test-dir
echo '{}' > package.json
touch entrypoint
touch test.mjs
/usr/bin/node --trace-warnings ./entrypoint test.mjs # <-- no error
/usr/bin/node --experimental-specifier-resolution=node --trace-warnings ./entrypoint test.mjs <-- no error
How often does it reproduce? Is there a required condition?
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
TypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected string to be returned for the "format" from the "loader getFormat" function but got type object.
at Loader.getFormat (internal/modules/esm/loader.js:110:13)
at async Loader.getModuleJob (internal/modules/esm/loader.js:230:20)
at async Loader.import (internal/modules/esm/loader.js:164:17)
at async Object.loadESM (internal/process/esm_loader.js:68:5) {
code: 'ERR_INVALID_RETURN_PROPERTY_VALUE'
}
Activity
module: fix specifier resolution option value
module: fix specifier resolution option value
module: fix specifier resolution option value
module: fix specifier resolution option value