From e6e89f9990c38acd30d422f281b7926db4796879 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sat, 31 Oct 2026 03:17:27 +0100 Subject: [PATCH] src: do not enable the inspector during snapshot building V8 no longer allows attaching a debuger or setting a debug context ID during snapshot building. Avoid enabling the inspector in this case, and reject the inspector options when the user-land --build-snapshot is used. Refs: https://chromium-review.googlesource.com/c/v8/v8/+/8679045 Signed-off-by: Joyee Cheung --- doc/api/cli.md | 4 +++ doc/node.1 | 3 ++ src/inspector_agent.cc | 12 ++++++- src/node_options.cc | 37 +++++++++++--------- src/node_options.h | 8 +++++ test/parallel/test-inspect-address-in-use.js | 11 ++++-- test/parallel/test-snapshot-console.js | 5 ++- 7 files changed, 58 insertions(+), 22 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index d3309ae6192d..415b65ac5efa 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -721,6 +721,10 @@ an additional module during the snapshot building process is needed, please file a request in the [Node.js issue tracker][] and link to it in the [tracking issue for user-land snapshots][]. +During snapshot building, a debugger cannot be attached to the process. +`--build-snapshot` cannot be used together with `--inspect`, `--inspect-brk` or +`--inspect-wait`. + ### `--build-snapshot-config`