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:
When i run
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 ?