Skip to content

feat(vercel): add support for skew protection - #3787

Merged
pi0 merged 3 commits into
mainfrom
feat/vercel-skew
Nov 16, 2025
Merged

pi0 merged 3 commits into
mainfrom
feat/vercel-skew

Conversation

@danielroe

@danielroe danielroe commented Nov 14, 2025 •

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #2311

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

seems like a relatively straightforward change

I'll open a similar one for netlify as well

having looked at both implementations, I'm not sure we need a manifest before merging this, but please do feel free to tell me if I've taken a wrong turn here.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@vercel

vercel Bot commented Nov 14, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nitro.build Ready Ready Preview Comment Nov 16, 2025 2:03pm

@pkg-pr-new

pkg-pr-new Bot commented Nov 14, 2025

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitrojs/nitro/nitropack@3787

commit: fd9ea71

@pi0

pi0 commented Nov 15, 2025 •

Copy link
Copy Markdown
Member

having looked at both implementations, I'm not sure we need a #2312 before merging this, but please do feel free to tell me if I've taken a wrong turn here.

Not (generated) manifest, but we need a configuration namespace manifest: { deploymentId } that stores VERCEL_DEPLOYMENT_ID.

Also can you please reopen on main branch? We can backport it later steps.

@danielroe danielroe mentioned this pull request Nov 16, 2025
2 of 3 tasks
Comment thread src/presets/vercel/utils.ts Resolved
Comment thread src/presets/vercel/utils.ts Resolved
Comment thread src/presets/vercel/types.ts Resolved
@pi0
pi0 merged commit 2587261 into main Nov 16, 2025
@pi0
pi0 deleted the feat/vercel-skew branch November 16, 2025 14:18
@gerynugrh

Copy link
Copy Markdown

Hi @danielroe this is really interesting, is there a way for me to use this right now?

@pi0

pi0 commented Dec 16, 2025

Copy link
Copy Markdown
Member

https://nitro.build/guide/nightly

julianbenegas pushed a commit to vercel/vercel that referenced this pull request Aug 17, 2026
The __vdpl cookie was appended to every SSR document response in
entry.server, and the CDN never stores responses carrying Set-Cookie,
so enabling Skew Protection forced BYPASS on all documents and made
Cache-Control: s-maxage unusable for React Router apps.

Emit a Build Output route instead (matched on Sec-Fetch-Dest: document,
continue: true) so the routing layer stamps the cookie on every outgoing
document response - including cache HITs and prerendered files - while
the function response stays free of Set-Cookie and cacheable. Same
approach as Nitro (nitrojs/nitro#3787).

Co-authored-by: Claude Fable 5 <[email protected]>
Crazytieguy added a commit to Crazytieguy/alignment-hive that referenced this pull request Sep 2, 2026
Skew Protection is enabled on the Vercel project but was inert: nothing in
the deployed app carried the deployment id, so a phone that had loaded the
page before a deploy fetched chunks whose hashes no longer existed and hit
the error boundary (the home-page 'Something went wrong' seen after several
deploys in an hour).

Nitro's Vercel preset sets the __vdpl cookie on document responses since
nitrojs/nitro#3787 (on by default when the dashboard toggle is on); the
pinned 3.0.1-alpha.1 predates it. Verified in a local Vercel-preset build
that the output config carries the Set-Cookie route.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

This branch was successfully deployed

1 active (outdated) deployment
Preview — f7f74ac1 Deployed Nov 16, 2025 by vercel[bot]
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.

Skew protection on Vercel

3 participants