From b0271b9bc88a1e2bfdc4b60af2e3a4d5560b6eeb 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: Refs: https://chromium-review.googlesource.com/c/v8/v8/+/8679045 --- doc/api/cli.md | 4 +++ src/inspector_agent.cc | 12 ++++++- src/node_options.cc | 38 +++++++++++--------- src/node_options.h | 8 +++++ test/parallel/test-inspect-address-in-use.js | 11 ++++-- test/parallel/test-snapshot-console.js | 5 ++- 6 files changed, 56 insertions(+), 22 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index bddd4a5c0a5f..b2d86238abf5 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -719,6 +719,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`