node/lib/internal
Joyee Cheung 8d10bc7b09 module: improve error message from asynchronicity in require(esm)
- Improve the error message that shows up when there is a race
  from doing require(esm) and import(esm) at the same time.
- Improve error message of ERR_REQUIRE_ASYNC_MODULE by showing
  parent and target file names, if available.

Drive-by: split the require(tla) tests since we are modifying
the tests already.

PR-URL: https://github.com/nodejs/node/pull/57126
Refs: https://github.com/fisker/prettier-issue-17139
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-20 17:22:08 +00:00
..
assert assert: make myers_diff function more performant 2025-01-11 21:11:09 +00:00
async_local_storage lib: improve async_context_frame structure 2024-08-09 19:44:42 +00:00
bootstrap src: port `defineLazyProperties` to native code 2025-02-18 21:23:01 +00:00
child_process child_process: fix parsing messages with splitted length field 2025-01-18 19:39:56 +00:00
cluster lib: add flag to drop connection when running in cluster mode 2024-10-17 15:11:41 +00:00
console diagnostics_channel: capture console messages 2025-01-13 12:51:31 +00:00
crypto crypto: add api to get openssl security level 2025-01-28 14:00:59 -05:00
debugger lib: prefer optional chaining 2024-09-24 19:48:15 +00:00
dns dns: add TLSA record query and parsing 2025-02-18 10:37:48 -08:00
events lib: remove `Symbol[Async]Dispose` polyfills 2024-10-07 09:47:44 +00:00
fs fs: make `FileHandle.readableWebStream` always create byte streams 2025-02-10 03:40:31 +00:00
http2 src: fix HTTP2 mem leak on premature close and ERR_PROTO 2025-01-21 15:53:42 -03:00
inspector inspector: add Network.Initiator in inspector protocol 2025-02-08 13:39:19 +00:00
legacy tools: add lint rule to keep primordials in ASCII order 2024-04-21 16:53:08 +00:00
main sea: suppress builtin warning with disableExperimentalSEAWarning option 2025-02-17 19:42:17 -08:00
modules module: improve error message from asynchronicity in require(esm) 2025-02-20 17:22:08 +00:00
per_context lib: move `Symbol[Async]Dispose` polyfills to `internal/util` 2024-09-10 21:24:56 +00:00
perf src,lib: optimize nodeTiming.uvMetricsInfo 2024-11-01 13:35:12 -03:00
process lib: allow skipping source maps in node_modules 2025-01-23 22:44:10 +00:00
quic src, quic: refine more of the quic implementation 2025-01-06 10:47:36 -08:00
readline readline: fix unresolved promise on abortion 2025-01-29 17:01:26 -08:00
repl lib: remove startsWith/endsWith primordials for char checks 2024-10-19 10:18:10 +00:00
source_map lib: allow skipping source maps in node_modules 2025-01-23 22:44:10 +00:00
streams Revert "stream: handle generator destruction from Duplex.from()" 2024-12-24 13:30:54 +00:00
test v8: implement v8.queryObjects() for memory leak regression testing 2024-03-02 22:11:30 +00:00
test_runner test_runner: allow special characters in snapshot keys 2025-02-19 06:34:08 +00:00
tls tls: add `allowPartialTrustChain` flag 2024-09-09 17:24:10 +02:00
util util: inspect: do not crash on an Error stack that contains a Symbol 2025-01-24 08:05:27 -08:00
v8 src: fixup Error.stackTraceLimit during snapshot building 2024-09-30 15:05:12 +00:00
vm vm: fix ASCII-betical order 2024-04-25 19:14:16 +00:00
watch_mode fs: prevent unwanted `dependencyOwners` removal 2024-11-17 11:52:05 +01:00
webstreams stream: fix typo in ReadableStreamBYOBReader.readIntoRequests 2025-01-13 15:11:47 +00:00
worker worker: refactor stdio to improve performance 2025-01-23 08:36:52 +00:00
README.md doc: add note about `--expose-internals` 2024-09-23 20:22:45 +00:00
abort_controller.js lib: clean up persisted signals when they are settled 2024-12-08 13:24:09 +01:00
assert.js lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
async_context_frame.js lib: make ALS default to AsyncContextFrame 2024-11-02 15:14:28 +00:00
async_hooks.js tools: add lint rule to keep primordials in ASCII order 2024-04-21 16:53:08 +00:00
blob.js src, quic: refine more of the quic implementation 2025-01-06 10:47:36 -08:00
blocklist.js net: add net.BlockList.isBlockList(value) 2024-12-04 07:48:30 -08:00
buffer.js buffer: throw when writing beyond buffer" 2024-09-28 08:21:43 -07:00
child_process.js lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
cli_table.js lib: align console.table row to the left 2023-10-28 01:14:22 +00:00
constants.js lib: add trailing commas to more internal files 2023-02-26 11:34:02 +01:00
data_url.js esm: use Undici/`fetch` `data:` URL parser 2024-09-07 10:22:03 +02:00
dgram.js lib: enforce ASCII order in error code imports 2024-04-23 17:05:38 +00:00
encoding.js util: add fast path for Latin1 decoding 2024-12-03 11:32:01 +00:00
error_serdes.js lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
errors.js module: improve error message from asynchronicity in require(esm) 2025-02-20 17:22:08 +00:00
event_target.js events: optimize EventTarget.addEventListener 2024-10-14 10:24:32 +00:00
file.js buffer: correctly apply prototype to cloned `File` / `Blob` 2024-09-28 22:05:58 +00:00
fixed_queue.js lib: ensure no holey array in fixed_queue 2024-09-02 01:42:44 +00:00
freelist.js
freeze_intrinsics.js tools: add lint rule to keep primordials in ASCII order 2024-04-21 16:53:08 +00:00
heap_utils.js tools: add lint rule to keep primordials in ASCII order 2024-04-21 16:53:08 +00:00
histogram.js lib: enforce ASCII order in error code imports 2024-04-23 17:05:38 +00:00
http.js src,lib: expose getCategoryEnabledBuffer to use on node.http 2024-07-16 18:40:22 +00:00
inspector_async_hook.js tools: add lint rule to keep primordials in ASCII order 2024-04-21 16:53:08 +00:00
inspector_network_tracking.js inspector: add undici http tracking support 2025-01-08 16:56:42 +00:00
js_stream_socket.js http2: fix h2-over-h2 connection proxying 2024-04-08 09:53:18 +00:00
linkedlist.js lib: add trailing commas to more internal files 2023-02-26 11:34:02 +01:00
mime.js util: pass invalidSubtypeIndex instead of trimmedSubtype to error 2023-12-25 04:29:00 +00:00
navigator.js src: use v8::Isolate::GetDefaultLocale() to compute navigator.language 2024-08-29 03:25:51 +00:00
net.js lib: enforce ASCII order in error code imports 2024-04-23 17:05:38 +00:00
options.js lib: prefer optional chaining 2024-09-24 19:48:15 +00:00
priority_queue.js test_runner: add Date to the supported mock APIs 2023-10-23 11:23:12 +00:00
promise_hooks.js tools: add lint rule to keep primordials in ASCII order 2024-04-21 16:53:08 +00:00
querystring.js lib: add trailing commas to more internal files 2023-02-26 11:34:02 +01:00
repl.js repl: add trailing commas in source files 2023-02-24 09:43:27 +01:00
socket_list.js lib: add trailing commas to more internal files 2023-02-26 11:34:02 +01:00
socketaddress.js net: add SocketAddress.parse 2024-12-04 09:29:30 -08:00
stream_base_commons.js stream: relocate the status checking code in the onwritecomplete 2024-09-02 07:29:17 +00:00
timers.js lib: improve async_context_frame structure 2024-08-09 19:44:42 +00:00
trace_events_async_hooks.js lib: add trailing commas to more internal files 2023-02-26 11:34:02 +01:00
tty.js tty: fix links for terminal colors 2024-09-24 22:26:59 +02:00
url.js url: add URLPattern implementation 2025-02-01 02:13:57 +00:00
util.js src: port `defineLazyProperties` to native code 2025-02-18 21:23:01 +00:00
v8_prof_polyfill.js lib: add trailing commas to more internal files 2023-02-26 11:34:02 +01:00
v8_prof_processor.js src: implement natives binding without special casing 2023-06-09 15:32:55 +02:00
validators.js zlib: simplify validators 2024-08-27 14:58:36 +00:00
vm.js typings: lib/internal/vm.js 2024-02-19 01:19:44 +00:00
wasm_web_api.js lib: add trailing commas to more internal files 2023-02-26 11:34:02 +01:00
watchdog.js lib: add trailing commas to more internal files 2023-02-26 11:34:02 +01:00
webidl.js lib: prefer symbol to number in webidl `type` function 2024-11-07 23:21:50 +00:00
webstorage.js src: move `ToNamespacedPath` call of webstorage 2024-07-21 20:49:10 +00:00
worker.js src: set worker thread name using worker.name 2025-02-06 01:36:27 +00:00

README.md

Internal Modules

The modules located in lib/internal directory are exclusively meant for internal usage within the Node.js core. They are not intended to be accessed via user modules require(). These modules may change at any point in time. Relying on these internal modules outside the core is not supported and can lead to unpredictable behavior.

In certain scenarios, accessing these internal modules for debugging or experimental purposes might be necessary. Node.js provides the --expose-internals flag to expose these modules to userland code. This flag only exists to assist Node.js maintainers with debugging internals. It is not meant for use outside the project.