fix(vercel): fix preview mode compat with srvx#4011
Merged
pi0 merged 1 commit intonitrojs:mainfrom Feb 10, 2026
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughThe change modifies the Vercel runtime initialization in the web preset to conditionally initialize Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@renantatsuo is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
MickaelV0
added a commit
to Roxabi/roxabi-talks
that referenced
this pull request
Mar 27, 2026
Nitro 3.0.0's Vercel Web preset was missing the vite env bridge that maps ssrRenderer to the TanStack Start SSR handler. Without it, ssrRenderer called globalThis.fetch on the original request, which hit the same Vercel function endpoint → INFINITE_LOOP_DETECTED (508). The beta adds fetchViteEnv() + globalThis.__nitro_vite_envs__ to the Vercel preset, routing SSR requests to ssr.mjs internally instead of over HTTP. Also adapts vite.config.ts to the new plugin API (preset is now a top-level property, not nested under config). Refs: nitrojs/nitro#3905, nitrojs/nitro#4011, TanStack/router#6562 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This was referenced Mar 27, 2026
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🔗 Linked issue
Resolves #3905
Also related: TanStack/router#6562
❓ Type of change
📚 Description
The Vercel preset was replacing the entire
req.runtimeobject (req.runtime = { name: "vercel", vercel: { context } }), discardingreq.runtime.nodeand causing aTypeError: Cannot destructure property 'req' of 'this.runtime.node' as it is undefinedin srvx's Node adapter.This fix uses
??=to match the same pattern used in the Netlify, Netlify Edge, and Cloudflare presets to setreq.runtimeand then setsreq.runtime.vercelseparately.📝 Checklist