Skip to content

fix: support all bundle strategies with Vercel Skew Protection - #17731

Merged
teemingc merged 2 commits into
mainfrom
triage/kit-17730-skew-bundle-strategies
Nov 12, 2026
Merged

teemingc merged 2 commits into
mainfrom
triage/kit-17730-skew-bundle-strategies

Conversation

@svelte-triage-bot

Copy link
Copy Markdown
Contributor

Fixes #17730

Skew Protection currently scans immutable/entry for start.* to attach the cookie that exempts version.json from deployment pinning. Single bundles have no such directory, so adaptation fails after the client/server builds succeed. Inline bundles likewise have no external entry request.

The separate-response workaround introduced in #11987 was necessary because the legacy route headers map could not express multiple cookies. Vercel's current Build Output API supports appending response headers with multiple values, and the adapter already uses routing transforms.

This removes the obsolete entry scan and appends both independent Set-Cookie values on the existing document route. The deployment cookie and the more-specific empty version cookie retain their scopes and security attributes; the exemption is now installed on the HTML response rather than a later JavaScript response. Branching the scan for each bundle strategy would retain unnecessary dependence on output filenames and entry requests, especially since inline output files are removed by #16025.

This covers split, single, and inline output, SSR and prerendered documents, and custom paths.base/appDir, without changing ISR dispatch, immutable caching, filesystem routing, or missing-asset handling.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 3438d74:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/3438d742430b1741a0fd6d568db3a25053f54714

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/kit/pr/17731

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3438d74

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@teemingc teemingc added pkg:adapter-vercel Pertaining to the Vercel adapter needs-platform-tests This PR needs to run platform tests in order to merge. labels Nov 11, 2026
@teemingc

Copy link
Copy Markdown
Member

@svelte-triage-bot remove the current test changes as they are redundant. Add a todo comment in the platform tests to add a skew protection test once #17732 is resolved

@svelte-triage-bot

Copy link
Copy Markdown
Contributor Author

Implemented the PR follow-up in commit 3438d742430b1741a0fd6d568db3a25053f54714: removed the redundant test changes and added the platform-test TODO referencing #17732. Relevant adapter and unit tests, formatting, lint, and checks pass.

Recorded the feedback in svelte-agent#84 and opened an implementation PR: svelte-agent#85.

@teemingc
teemingc marked this pull request as ready for review November 12, 2026 01:24
@svelte-docs-bot

Copy link
Copy Markdown

@teemingc
teemingc merged commit 415f856 into sveltejs:main Nov 12, 2026
38 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 12, 2026
teemingc pushed a commit that referenced this pull request Nov 17, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @sveltejs/[email protected]

### Patch Changes

- fix: set `X-Accel-Buffering: no` on `text/event-stream` responses
whose content type has parameters, such as `charset=utf-8`
([#17687](#17687))
- Updated dependencies:
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Patch Changes

- fix: support all bundle strategies with Vercel Skew Protection
([#17731](#17731))
- Updated dependencies:
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Patch Changes

- fix: check the return value of async `load` functions against
`App.PageData` ([#17793](#17793))

- fix: prerender crawler finds links located after a quoted attribute
value ending with `\`
([#17688](#17688))

- fix: omit nopush from preload Link headers so Chromium can use CDN
Early Hints ([#17786](#17786))

- perf: hash a page's encoded bytes for its `ETag` and send the same
bytes as the body, and skip the hash when `setHeaders` already sets an
`etag` or the response is `no-store`
([#17674](#17674))

- chore: deprecate `adapter.emulate`
([#17769](#17769))

- fix: generate valid types for route params whose names start with a
digit, such as `[2nd]`
([#17661](#17661))

- perf: skip the `ETag` hash for a page that has a CSP nonce in it,
since no two responses are the same
([#17743](#17743))

- fix: correctly scan routes on Windows when optimising dependencies
([#17757](#17757))
## @sveltejs/[email protected]

### Patch Changes

- fix: remove transformed output files when sources are deleted in watch
mode ([#17519](#17519))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-platform-tests This PR needs to run platform tests in order to merge. pkg:adapter-vercel Pertaining to the Vercel adapter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adapter-vercel: build fails with bundleStrategy: 'single' when Skew Protection is enabled

1 participant