node/lib/internal/modules
Craig Macomber (Microsoft) dda95e91b9
esm: avoid throw when module specifier is not url
This particular exception is responsible for a lot of overhead when
debugging with large esm codebases with VS Code and break on caught
exceptions is enabled.

VS Code silently suppresses this exception, but the mechanism it uses
to do so is a bit slow so avoiding this common exception can speed up
loading of esm code.

In my scenario this saved over have of the startup run time
(over 20 seconds).
This should also make debugging without suppression of this exception
more pleasant in other tools such as the Chrome dev tools when
attached to NodeJs processes.

PR-URL: https://github.com/nodejs/node/pull/61000
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2026-02-24 00:37:11 +01:00
..
cjs module: preserve URL in the parent created by createRequire() 2026-02-17 15:14:21 +01:00
esm esm: avoid throw when module specifier is not url 2026-02-24 00:37:11 +01:00
customization_hooks.js module: convert schema-only core module on convertCJSFilenameToURL 2025-07-24 20:08:27 +02:00
helpers.js module: fix conditions override in synchronous resolve hooks 2025-08-20 17:11:45 +02:00
package_json_reader.js src: reduce the nearest parent package JSON cache size 2025-10-07 17:29:38 +02:00
run_main.js esm: support top-level Wasm without package type 2025-05-19 12:13:50 +02:00
typescript.js lib: fix getTypeScriptParsingMode jsdoc 2025-07-24 20:08:27 +02:00