Skip to content

Forward user optimizeDeps settings to SSR environments in Cloudflare adapter#16769

Merged
matthewp merged 3 commits into
mainfrom
flue/fix-16491
May 20, 2026
Merged

Forward user optimizeDeps settings to SSR environments in Cloudflare adapter#16769
matthewp merged 3 commits into
mainfrom
flue/fix-16491

Conversation

@astrobot-houston

Copy link
Copy Markdown
Contributor

Changes

  • Forwards user-provided optimizeDeps.exclude, optimizeDeps.include, and optimizeDeps.esbuildOptions.loader from the Astro config to SSR/prerender environments in the Cloudflare adapter
  • Fixes packages with non-standard file extensions (like .data) failing during dev-mode dependency optimization
  • Resolves issue where top-level vite.optimizeDeps configuration was silently ignored for server environments due to Vite 6's client-scoped design

Testing

  • Added packages/integrations/cloudflare/test/user-optimize-deps.test.ts with a test that imports a package with .data files to verify the exclude configuration works
  • Test uses a fake-data-pkg fixture that would fail without the fix but succeeds when optimizeDeps.exclude is properly forwarded

Docs

  • No docs update needed, this fix restores expected behavior where user Vite config applies to all environments.

Closes #16491

@astrobot-houston astrobot-houston added the fix verified Reporter confirmed the triage bot fix works label May 18, 2026
@github-actions github-actions Bot added the pkg: integration Related to any renderer integration (scope) label May 18, 2026
@changeset-bot

changeset-bot Bot commented May 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3a2ebd7

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

This PR includes changesets to release 37 packages
Name Type
@astrojs/cloudflare Patch
@test/astro-cloudflare-node-prerender-mdx Patch
@test/astro-cloudflare Patch
@test/astro-cloudflare-allowed-hosts Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-binding-image-service Patch
@test/astro-cloudflare-cache-provider-wait-until Patch
@test/astro-cloudflare-client-address Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-custom-entryfile Patch
@test/astro-cloudflare-dev-image-endpoint Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-external-redirects Patch
@test/astro-cloudflare-internal-redirects Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-prerender-node-env Patch
@test/astro-cloudflare-prerender-queue-consumers Patch
@test/astro-cloudflare-prerender-styles Patch
@test/astro-cloudflare-prerenderer-errors Patch
@test/routing-priority-cloudflare Patch
@test/cf-server-entry Patch
@test/astro-cloudflare-server-island-prerender-framework Patch
@test/astro-cloudflare-sessions Patch
@test/astro-cloudflare-sql-import Patch
@test/cf-ssr-deps Patch
@test/astro-cloudflare-static Patch
@test/astro-cloudflare-svelte-rune-deps Patch
@test/astro-cloudflare-top-level-return Patch
@test/cf-user-optimize-deps Patch
@test/astro-cloudflare-vite-plugin Patch
@test/astro-cloudflare-with-base Patch
@test/astro-cloudflare-with-react Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-with-svelte Patch
@test/astro-cloudflare-with-vue Patch
@test/astro-cloudflare-wrangler-preview-platform 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

@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

e18e dependency analysis

No dependency warnings found.

@matthewp

Copy link
Copy Markdown
Contributor

@copilot can you fix the build errors

Copilot AI commented May 20, 2026

Copy link
Copy Markdown
Contributor

@copilot can you fix the build errors

Fixed in 3a2ebd7. The build failures were caused by a pnpm tarball integrity mismatch for the new fake-data-pkg fixture; I updated the pnpm-lock.yaml checksum to match the committed tarball, and dependency install now succeeds.

Copilot AI requested a review from matthewp May 20, 2026 18:43
@matthewp matthewp merged commit 428cb1b into main May 20, 2026
25 checks passed
@matthewp matthewp deleted the flue/fix-16491 branch May 20, 2026 19:38
@astrobot-houston astrobot-houston mentioned this pull request May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix verified Reporter confirmed the triage bot fix works pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Astro is unable to load .data and .wasm file

3 participants