Skip to content

breaking: remove support for Cloudflare Pages - #16604

Open
teemingc wants to merge 12 commits into
version-3from
breaking-remove-cloudflare-pages
Open

breaking: remove support for Cloudflare Pages#16604
teemingc wants to merge 12 commits into
version-3from
breaking-remove-cloudflare-pages

Conversation

@teemingc

@teemingc teemingc commented Jul 31, 2026

Copy link
Copy Markdown
Member

closes #15060

We will eventually need to do this when Cloudflare officially sunsets Cloudflare Pages or when we add integration for the Cloudflare Vite plugin anyway. Doing it earlier will make the latter easier.

This PR:

  • removes the test app for cloudflare pages
  • changes the auto adapter to detect the Cloudflare Workers Builds environment instead
  • adds a check to the Cloudflare adapter to tell users to migrate to Cloudflare Workers

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Jul 31, 2026

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 2138166:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/2138166848da32e6cbba90dabe6daf898dba3de6

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

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2138166

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

This PR includes changesets to release 2 packages
Name Type
@sveltejs/adapter-auto Major
@sveltejs/adapter-cloudflare Major

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 changed the title breaking: remove support for cloudflare pages breaking: remove support for Cloudflare Pages Jul 31, 2026
@svelte-docs-bot

Copy link
Copy Markdown

Comment thread .changeset/eager-poets-battle.md Outdated
Comment on lines 38 to +39
* Only for Cloudflare Pages. Customize the automatically-generated [`_routes.json`](https://developers.cloudflare.com/pages/platform/functions/routing/#create-a-_routesjson-file) file.
* @deprecated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Only for Cloudflare Pages. Customize the automatically-generated [`_routes.json`](https://developers.cloudflare.com/pages/platform/functions/routing/#create-a-_routesjson-file) file.
* @deprecated
* @deprecated Cloudflare Pages is no longer supported

the fallback JSDoc above also still has the Pages paragraphs

// TODO: remove migration helper in a future major version
if (is_building_for_cloudflare_pages(wrangler_config)) {
throw new Error(
'@sveltejs/adapter-cloudflare no longer supports Cloudflare Pages. Please follow the migration guide to move your project to Cloudflare Workers https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'@sveltejs/adapter-cloudflare no longer supports Cloudflare Pages. Please follow the migration guide to move your project to Cloudflare Workers https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/'
'@sveltejs/adapter-cloudflare no longer supports Cloudflare Pages. Please follow the migration guide to move your project to Cloudflare Workers https://developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/ If you have already migrated, delete the leftover `_routes.json` file from your project root.'

for people who migrated but kept a stale _routes.json

Comment thread packages/adapter-cloudflare/index.js Outdated
@@ -78,92 +84,6 @@ export function parse_redirects(file_contents) {
return redirects;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parse_redirects lost its only caller, can go too (plus its tests)

teemingc and others added 2 commits August 2, 2026 07:27
Co-authored-by: Nic Polumeyv <nicolas.polum@outlook.com>
Co-authored-by: Nic Polumeyv <nicolas.polum@outlook.com>
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.

@sveltejs/adapter-auto not detecting Cloudflare Workers

2 participants