TanStackT
TanStack3mo ago
20 replies
awake-maroon

Deploying to Cloudflare issues

Hi everyone! I recently started looking into tanstack start and wanted to deploy my first project to cloudflare workers. But I'm having some issues with building the project. Here's my vite config:
import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; import { tanstackStart } from "@tanstack/react-start/plugin/vite"; import tailwindcss from "@tailwindcss/vite"; import viteReact from "@vitejs/plugin-react"; import { cloudflare } from "@cloudflare/vite-plugin"; export default defineConfig({ plugins: [ tsconfigPaths(), cloudflare({ viteEnvironment: { name: "ssr" } }), tailwindcss(), tanstackStart(), viteReact(), ], });
When i run bun run build i get error from screenshot. It says that i can't use env like that:
import { env } from "cloudflare:workers";. What should i do ?
2025-10-28_16.53.57.png
Was this page helpful?