doc: fix URL postMessage example in worker_threads by kovan · Pull Request #62203 · nodejs/node · GitHub
Skip to content

doc: fix URL postMessage example in worker_threads#62203

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
kovan:doc-worker-url-postmessage
May 26, 2026
Merged

doc: fix URL postMessage example in worker_threads#62203
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
kovan:doc-worker-url-postmessage

Conversation

@kovan

@kovan kovan commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

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.ccURL 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

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

kovan commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

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

New head: dc38a01

@aduh95 aduh95 added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels May 26, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label May 26, 2026
@nodejs-github-bot nodejs-github-bot merged commit 424b9c3 into nodejs:main May 26, 2026
19 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

aduh95 pushed a commit that referenced this pull request May 27, 2026
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: #60504

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
PR-URL: #62203
Fixes: #60504
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
sxa pushed a commit to sxa/node that referenced this pull request Jun 18, 2026
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>
PR-URL: nodejs#62203
Fixes: nodejs#60504
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
sxa pushed a commit that referenced this pull request Jun 18, 2026
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: #60504

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
PR-URL: #62203
Fixes: #60504
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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. 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