Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix getRandomValues
  • Loading branch information
ijjk committed Mar 22, 2025
commit 1ad49fdd6220d9bb7bb5be0df12a690f0dd69608
3 changes: 2 additions & 1 deletion packages/next/src/server/lib/router-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export async function initialize(opts: {
// handle node v16 not having global webcrypto
const crypto = require('crypto')
const webcrypto = crypto.webcrypto || crypto
webcrypto.getRandomValues.getRandomValues(randomBytes)
webcrypto.getRandomValues(randomBytes)

const middlewareSubrequestId = Buffer.from(randomBytes).toString('hex')
;(globalThis as any)[Symbol.for('@next/middleware-subrequest-id')] =
middlewareSubrequestId
Expand Down
Loading