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
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'
}
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#L28What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
/usr/bin/node --experimental-specifier-resolution=node --trace-warnings ./entrypoint test.mjs
Should print the following to stdout:
What do you see instead?
/usr/bin/node --es-module-specifier-resolution=node --trace-warnings ./entrypoint test.mjs
returns code: 'ERR_INVALID_RETURN_PROPERTY_VALUE'I believe the
es-module-specifier-resolution
option was deprecated in v13.4.0Additional information
https://github.com/nodejs/node/blob/master/lib/internal/modules/run_main.js#L28
The text was updated successfully, but these errors were encountered: