Skip to content

breaking: disallow paths.assets in adapter-cloudflare - #17751

Merged
teemingc merged 111 commits into
mainfrom
claude/cloudflare-reject-paths-assets
Nov 18, 2026
Merged

teemingc merged 111 commits into
mainfrom
claude/cloudflare-reject-paths-assets

Conversation

@teemingc

@teemingc teemingc commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Stacked on top of #17520

Once #17521 is merged, vite preview will run the built Worker in workerd, which makes it such that we can't easily mock paths.assets during preview like we do now in Node.js. Most apps on Cloudflare will not use another CDN anyway since the Worker serves its own static assets so there isn't a real need for that option for users of this adapter.

This PR makes it so that the adapter will throw the following message when paths.assets is set:

@sveltejs/adapter-cloudflare does not support paths.assets. Remove it from your SvelteKit configuration.

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

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.

teemingc and others added 30 commits October 21, 2026 18:29
…ite-plugin`

Applies the Worker environment config generated by `@cloudflare/vite-plugin`
to the SSR build so that dependencies are bundled with the workerd export
conditions and CommonJS `require` calls of Node builtins become imports
instead of `createRequire(import.meta.url)`, which crashes in workerd.

closes #15960

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…' into claude/cloudflare-workers-build-output

# Conflicts:
#	documentation/docs/25-build-and-deploy/60-adapter-cloudflare.md
#	packages/adapter-cloudflare/index.spec.js
@pkg-svelte-dev

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

Copy link
Copy Markdown

Install the latest version of @sveltejs/kit from 3fcdfc6:

pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/3fcdfc686d89de52cea627ea1e31ac9002cc0872

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

@changeset-bot

changeset-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3fcdfc6

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-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

@svelte-docs-bot

Copy link
Copy Markdown

@teemingc teemingc mentioned this pull request Nov 13, 2026
6 of 19 tasks
);
}

return {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Diff looks big but we're just changing indentation here

@teemingc teemingc added pkg:adapter-cloudflare needs-platform-tests This PR needs to run platform tests in order to merge. labels Nov 13, 2026
@teemingc
teemingc marked this pull request as ready for review November 13, 2026 17:10
@teemingc
teemingc requested a review from ottomated November 13, 2026 20:35
Base automatically changed from claude/cloudflare-workers-build-output to main November 18, 2026 15:08
Comment thread packages/adapter-cloudflare/index.js Resolved
@teemingc
teemingc merged commit e675781 into main Nov 18, 2026
41 checks passed
@teemingc
teemingc deleted the claude/cloudflare-reject-paths-assets branch November 18, 2026 21:47
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
teemingc pushed a commit that referenced this pull request Nov 18, 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]

### Major Changes

- breaking: automatically build for Cloudflare Workers rather than
Cloudflare Pages ([#17479](#17479))

### Patch Changes

- Updated dependencies:
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Major Changes

- breaking: use the adapter `worker` option to control if a Worker is
built ([#17520](#17520))

- breaking: set the Wrangler config `main` setting automatically
([#17520](#17520))

- breaking: reject `paths.assets`, which can't be served when previewing
in workerd ([#17751](#17751))

- breaking: remove Cloudflare Pages support
([#17479](#17479))

- breaking: remove the adapter `fallback` option in favour of Wrangler's
`assets.not_found_handling` setting
([#17520](#17520))

### Minor Changes

- feat: support unbundled deployments
([#17520](#17520))

### Patch Changes

- fix: use the Wrangler environment resolved from `CLOUDFLARE_ENV` in
`.env` files for platform bindings during development
([#17520](#17520))
- Updated dependencies:
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Minor Changes

- feat: add `@sveltejs/adapter-server`, the building blocks shared by
adapters that generate a standalone server
([#17308](#17308))
## @sveltejs/[email protected]

### Minor Changes

- feat: allow adapters to disable SvelteKit's Node preview server with
`vite.customPreview: true` when providing their own preview
implementation ([#17750](#17750))

- feat: add `sveltekit.remote.call.file` attribute to remote function
tracing spans ([#17760](#17760))

### Patch Changes

- fix: strip trailing route groups when resolving routes with search
parameters or fragments
([#17808](#17808))

- fix: correctly display non-ASCII characters for plain text error
messages during development
([#17468](#17468))

- fix: explain missing TypeScript compiler API instead of crashing with
TypeScript 7 ([#17539](#17539))

- fix: reject remote function requests that use the wrong HTTP method
([#17740](#17740))

- fix: respect `NO_COLOR` and explicit `FORCE_COLOR` settings in forked
build processes ([#17618](#17618))
## @sveltejs/[email protected]

### Patch Changes

- fix: honour q-values in `Accept-Encoding` and serve dotfiles below
`.well-known`, matching `@sveltejs/adapter-node`
([#17308](#17308))
- Updated dependencies:
  - @sveltejs/[email protected]
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Patch Changes

- chore: build on `@sveltejs/adapter-server`
([#17308](#17308))
- Updated dependencies:
  - @sveltejs/[email protected]
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Patch Changes

- fix: avoid build warnings for missing optional peer dependencies
([#17802](#17802))
- Updated dependencies:
  - @sveltejs/[email protected]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions Bot added a commit to clement-songis/sveltekit-adapter-bun that referenced this pull request Nov 23, 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]

### Major Changes

- breaking: automatically build for Cloudflare Workers rather than
Cloudflare Pages ([#17479](sveltejs/kit#17479))

### Patch Changes

- Updated dependencies:
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Major Changes

- breaking: use the adapter `worker` option to control if a Worker is
built ([#17520](sveltejs/kit#17520))

- breaking: set the Wrangler config `main` setting automatically
([#17520](sveltejs/kit#17520))

- breaking: reject `paths.assets`, which can't be served when previewing
in workerd ([#17751](sveltejs/kit#17751))

- breaking: remove Cloudflare Pages support
([#17479](sveltejs/kit#17479))

- breaking: remove the adapter `fallback` option in favour of Wrangler's
`assets.not_found_handling` setting
([#17520](sveltejs/kit#17520))

### Minor Changes

- feat: support unbundled deployments
([#17520](sveltejs/kit#17520))

### Patch Changes

- fix: use the Wrangler environment resolved from `CLOUDFLARE_ENV` in
`.env` files for platform bindings during development
([#17520](sveltejs/kit#17520))
- Updated dependencies:
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Minor Changes

- feat: add `@sveltejs/adapter-server`, the building blocks shared by
adapters that generate a standalone server
([#17308](sveltejs/kit#17308))
## @sveltejs/[email protected]

### Minor Changes

- feat: allow adapters to disable SvelteKit's Node preview server with
`vite.customPreview: true` when providing their own preview
implementation ([#17750](sveltejs/kit#17750))

- feat: add `sveltekit.remote.call.file` attribute to remote function
tracing spans ([#17760](sveltejs/kit#17760))

### Patch Changes

- fix: strip trailing route groups when resolving routes with search
parameters or fragments
([#17808](sveltejs/kit#17808))

- fix: correctly display non-ASCII characters for plain text error
messages during development
([#17468](sveltejs/kit#17468))

- fix: explain missing TypeScript compiler API instead of crashing with
TypeScript 7 ([#17539](sveltejs/kit#17539))

- fix: reject remote function requests that use the wrong HTTP method
([#17740](sveltejs/kit#17740))

- fix: respect `NO_COLOR` and explicit `FORCE_COLOR` settings in forked
build processes ([#17618](sveltejs/kit#17618))
## @sveltejs/[email protected]

### Patch Changes

- fix: honour q-values in `Accept-Encoding` and serve dotfiles below
`.well-known`, matching `@sveltejs/adapter-node`
([#17308](sveltejs/kit#17308))
- Updated dependencies:
  - @sveltejs/[email protected]
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Patch Changes

- chore: build on `@sveltejs/adapter-server`
([#17308](sveltejs/kit#17308))
- Updated dependencies:
  - @sveltejs/[email protected]
  - @sveltejs/[email protected]
## @sveltejs/[email protected]

### Patch Changes

- fix: avoid build warnings for missing optional peer dependencies
([#17802](sveltejs/kit#17802))
- Updated dependencies:
  - @sveltejs/[email protected]

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

breaking change needs-platform-tests This PR needs to run platform tests in order to merge. pkg:adapter-cloudflare

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants