Skip to content

Link Node crypto prerender errors to the crypto error page - #102252

Merged
aurorascharff merged 1 commit into
canaryfrom
codex/fix-node-crypto-prerender-links
Nov 23, 2026
Merged

aurorascharff merged 1 commit into
canaryfrom
codex/fix-node-crypto-prerender-links

Conversation

@aurorascharff

Copy link
Copy Markdown
Contributor

When a Server Component calls a synchronous Node crypto API such as randomBytes(16) during prerendering, the terminal names the right function but links to the Math.random() error page. The dev overlay already links the same call to the crypto page.

Classify the seven instrumented node:crypto calls as crypto so the terminal prints the same link:

-Learn more: https://nextjs.org/docs/messages/blocking-prerender-random
+Learn more: https://nextjs.org/docs/messages/blocking-prerender-crypto

Verification

  • Exercised all seven Node API wrappers against the diagnostic factories before and after the change. Checked the server, runtime-prerender, and client error URLs, with Math.random() and callback-based randomBytes and randomInt as controls.
  • Updated the 32 affected production build snapshots across eight routes in the existing end-to-end suite. The four getRandomValues snapshots already pointed to the crypto page.

Found while reviewing #102245. This fix can merge independently.

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Vercel Agent finished reviewing your changes and found no issues.
76c627b • Mon, 23 Nov 2026 20:36:48 GMT • 1m 16s • Details

Checked (3)

     Check Location
All seven Node crypto wrappers select crypto diagnostics without changing native calls or callback guards.
A Python comparison against the merge base confirmed that the seven io() classification arguments are the only implementation changes.
node-crypto.tsx:23
Crypto classification selects the crypto documentation URL for server, runtime, and client diagnostics.
Traced io-utils.tsx into all three diagnostic factories; classification affects URL selection, not interruption or abort conditions.
sync-io-messages.ts:3
The updated snapshots cover all seven wrappers through eight real prerendered routes.
Traced suite registration, next.build() prerender setup, and route fixtures; a Python comparison confirmed exactly 32 URL-only snapshot replacements.
sync-io-node-crypto.util.ts:15
Review steps

     Step Time
Preparing the workspace 15.9s
Analyzing the changes 57.2s
Finalizing the review 2.4s

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 76c627b
View workflow run

@aurorascharff
aurorascharff marked this pull request as ready for review November 23, 2026 20:36

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vercel Agent Verified Review approves this commit: no issues found, and the change meets this repository’s review rules. Report

@vercel

vercel Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Vercel Agent Verified Review finished reviewing your changes and approved this pull request.
76c627b • Mon, 23 Nov 2026 20:37:26 GMT • 1m 6s • Report • Details

Everything checks out under the repository’s review policy.

Summary

Changes the seven node:crypto prerender wrappers (randomUUID, randomBytes, randomFillSync, randomInt, generatePrimeSync, generateKeyPairSync, generateKeySync) to report their sync IO as type 'crypto' instead of 'random', so terminal errors link to blocking-prerender-crypto(-client) like the dev overlay already does. The 32 matching e2e build snapshots are updated.

Checked (5)

     Check Location
All seven node:crypto wrappers now pass 'crypto', matching web-crypto.tsx's classification.
Grepped io(...) calls in node-environment-extensions; every node-crypto and web-crypto call uses 'crypto'.
node-crypto.tsx:26
The 'crypto' type maps to existing docs pages for server, runtime, and client errors.
Read SYNC_IO_DOCS/CLIENT/RUNTIME maps and confirmed errors/blocking-prerender-crypto.mdx and -crypto-client.mdx exist.
sync-io-messages.ts:1
The type only changes the docs URL; abort and staging behavior in io() is unchanged.
Read io(): type is only forwarded to the createSyncIO*Error message builders; elapsedTimeBullet only differs for 'time'.
io-utils.tsx:14
Terminal links now agree with the dev overlay's per-expression mapping for node:crypto.
Compared overlay SYNC_IO_DOCS entries for require('node:crypto').* with the new type; both resolve to blocking-prerender-crypto.
instant-guidance-data.ts:948
No remaining node:crypto snapshot still expects the random docs URL.
grep for blocking-prerender-random in sync-io-node-crypto.util.ts returns nothing; remaining hits in other suites are Math.random() cases.
sync-io-node-crypto.util.ts:79
Review steps

     Step Time
Sandbox set up 20.8s
Repository rules read: REVIEW.md and AGENTS.md files (3)
Agent review: 2 of 2 changed files opened, 1 command run 43.5s
Repros run on the head and the base (0), findings graded (0) 1.8s

Read the full report ↗ (Download report.json • report.md)

@aurorascharff
aurorascharff enabled auto-merge (squash) November 23, 2026 20:38
@aurorascharff
aurorascharff merged commit 63afeee into canary Nov 23, 2026
128 checks passed
@aurorascharff
aurorascharff deleted the codex/fix-node-crypto-prerender-links branch November 23, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant