Skip to content

doc: document heap profile error codes - #67614

Open
farisbasha wants to merge 1 commit into
nodejs:mainfrom
farisbasha:doc-heap-profile-error-codes
Open

farisbasha wants to merge 1 commit into
nodejs:mainfrom
farisbasha:doc-heap-profile-error-codes

Conversation

@farisbasha

@farisbasha farisbasha commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

v8.startHeapProfile() and worker.startHeapProfile() can throw ERR_HEAP_PROFILE_HAVE_BEEN_STARTED and ERR_HEAP_PROFILE_NOT_STARTED.
These two codes are not in errors.md, so I added them next to the CPU profile codes.
Also worker.startHeapProfile() says it was added in v22.20.0, but this API is not in Node 22 (lib/internal/worker.js in v22.x has no startHeapProfile), so I removed that version.
I used an AI assistant to find this. (i checked all myself
.)

`v8.startHeapProfile()`, `SyncHeapProfileHandle.stop()` and the
worker `startHeapProfile()`/`HeapProfileHandle.stop()` APIs throw or
reject with `ERR_HEAP_PROFILE_HAVE_BEEN_STARTED` and
`ERR_HEAP_PROFILE_NOT_STARTED`, but neither code is listed in
`errors.md`.

Also drop `v22.20.0` from the `added:` metadata of
`worker.startHeapProfile()`: the heap profile API was not backported
to v22.x (it is not in `lib/internal/worker.js` up to v22.23.5).

Signed-off-by: farisbasha <farisbashatm@gmail.com>
@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to Node.js documentation. label Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to Node.js documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants