Skip to content

doc: fix URL postMessage example in worker_threads#62203

Open
kovan wants to merge 1 commit into
nodejs:mainfrom
kovan:doc-worker-url-postmessage
Open

doc: fix URL postMessage example in worker_threads#62203
kovan wants to merge 1 commit into
nodejs:mainfrom
kovan:doc-worker-url-postmessage

Conversation

@kovan
Copy link
Copy Markdown
Contributor

@kovan kovan commented Mar 11, 2026

Fix the postMessage(new URL(...)) example in doc/api/worker_threads.md which claims to print {} but actually throws DataCloneError since v21.0.0 (d920b7c).

Verified against src/node_messaging.cc β€” URL objects are not serializable and throw DataCloneError: Cannot clone object of unsupported type.

Fixes: #60504

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. worker Issues and PRs related to Worker support. labels Mar 11, 2026
@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels May 19, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels May 19, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/62203
βœ”  Done loading data for nodejs/node/pull/62203
----------------------------------- PR info ------------------------------------
Title      doc: fix URL postMessage example in worker_threads (#62203)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     kovan:doc-worker-url-postmessage -> nodejs:main
Labels     doc, author ready, worker
Commits    1
 - doc: fix URL postMessage example in worker_threads
Committers 1
 - kovan <xaum.io@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62203
Fixes: https://github.com/nodejs/node/issues/60504
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/62203
Fixes: https://github.com/nodejs/node/issues/60504
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
--------------------------------------------------------------------------------
   β„Ή  This PR was created on Wed, 11 Mar 2026 10:21:10 GMT
   βœ”  Approvals: 1
   βœ”  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/62203#pullrequestreview-3949229592
   βœ”  Last GitHub CI successful
   β„Ή  Green GitHub CI is sufficient
--------------------------------------------------------------------------------
   βœ”  No git cherry-pick in progress
   βœ”  No git am in progress
   βœ”  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
βœ”  origin/main is now up-to-date
- Downloading patch for 62203
From https://github.com/nodejs/node
 * branch                  refs/pull/62203/merge -> FETCH_HEAD
βœ”  Fetched commits as 5605f6bca4be..4c63b211a5e6
--------------------------------------------------------------------------------
Auto-merging doc/api/worker_threads.md
[main fda8b92a33] doc: fix URL postMessage example in worker_threads
 Author: kovan <xaum.io@gmail.com>
 Date: Wed Mar 11 01:40:09 2026 +0100
 1 file changed, 3 insertions(+), 6 deletions(-)
   βœ”  Patches applied
--------------------------------------------------------------------------------
--------------------------------- New Message ----------------------------------
doc: fix URL postMessage example in worker_threads

The example claimed that posting a URL object via MessageChannel would
print an empty object, but since v21.0.0 (commit d920b7c94b8) it
throws a DataCloneError. Update the example and surrounding text to
reflect the current behavior.

Fixes: #60504

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR-URL: #62203
Fixes: #60504
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

[main 7ee82b463a] doc: fix URL postMessage example in worker_threads
Author: kovan <xaum.io@gmail.com>
Date: Wed Mar 11 01:40:09 2026 +0100
1 file changed, 3 insertions(+), 6 deletions(-)
βœ– 7ee82b463a72434d1b0a6d876d69aab38f4da790
βœ” 0:0 no Assisted-by metadata assisted-by-is-trailer
βœ” 0:0 Co-authored-by is a trailer co-authored-by-is-trailer
βœ” 6:7 Valid fixes URL. fixes-url
βœ” 0:0 blank line after title line-after-title
βœ” 0:0 line-lengths are valid line-length
βœ” 0:0 metadata is at end of message metadata-end
βœ” 9:8 PR-URL is valid. pr-url
βœ” 0:0 reviewers are valid reviewers
βœ– 0:0 Commit must have a "Signed-off-by" trailer signed-off-by
βœ” 0:0 valid subsystems subsystem
βœ” 0:0 Title is formatted correctly. title-format
βœ” 0:0 Title is <= 50 columns. title-length

β„Ή Please fix the commit message and try again.
Please manually ammend the commit message, by running
git commit --amend
Once commit message is fixed, finish the landing command running
git node land --continue

https://github.com/nodejs/node/actions/runs/26131088912

The example claimed that posting a URL object via MessageChannel would
print an empty object, but since v21.0.0 (commit d920b7c) it
throws a DataCloneError. Update the example and surrounding text to
reflect the current behavior.

Fixes: nodejs#60504

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
@kovan kovan force-pushed the doc-worker-url-postmessage branch from 4c63b21 to dc38a01 Compare May 20, 2026 05:16
@kovan
Copy link
Copy Markdown
Contributor Author

kovan commented May 20, 2026

Added the missing Signed-off-by trailer and force-pushed the PR branch.

New head: dc38a01

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. doc Issues and PRs related to the documentations. worker Issues and PRs related to Worker support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Example snippet does not behave like it should

4 participants