Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify nodeFsOrThrow exposes sync variants in all runtimes.
We now rely on
mkdirSyncandwriteFileSync. EnsurenodeFsOrThrow()always returns these in supported Next.js server runtimes (Node.js only), and its type definition reflects that.Run this repo-scoped script to confirm the implementation and typings of
nodeFsOrThrow:🏁 Script executed:
Length of output: 10556
🏁 Script executed:
Length of output: 1302
Enforce FS sync methods in types
At runtime
nodeFsOrThrow()returns the real Node.jsfsmodule (which includesmkdirSync,writeFileSync, etc.), so your usages inkeyless-telemetry.tsare safe. However, because we import#safe-node-apiswith@ts-ignore,nodeFsOrThrow()is currently typed asanyand does not guarantee those sync methods at compile time.To fully verify and enforce that callers always have access to the sync variants, please:
packages/nextjs/src/server/fs/utils.ts, change the signature ofnodeFsOrThrowto explicitly return Node’sfstype:#safe-node-apisso that itsfsexport is correctly typed. For example, create apackages/nextjs/src/server/fs/utils.d.ts(or in your global types) with:These changes ensure the compiler will flag any missing sync methods immediately and align the types with the actual runtime behavior.
🤖 Prompt for AI Agents