Vite plugin does not work with Cloudflare vite plugin

Author: kigawasCreated Jun 8, 2025Updated Sep 16, 2025
Labelspending triage

Describe the bug

Run pnpm create cloudflare@latest my-react-router-app --framework=react-router and update vite config. Or see reproduction below.

typescript
Error: The following environment configurations are incompatible with the Cloudflare Vite plugin:
        - "ssr" environment: `resolve.external`: ["@vanilla-extract/css","@vanilla-extract/css/fileScope","@vanilla-extract/css/adapter"]
To resolve this issue, avoid setting `optimizeDeps.exclude` and `resolve.external` in your Cloudflare Worker environments.

Reproduction

https://github.com/kigawas/vanilla-extract-cloudflare

System Info

bash
Not related

Used Package Manager

pnpm

Logs

bash

Validations

Source: vanilla-extract-css/vanilla-extract