TanStackT
TanStack7mo ago
17 replies
sad-indigo

I started a new project with Clerk and Convex, target deployment to CF Workers, build errors

I set up development and production environments in wrangler.toml and I'm attempting deployments both via GH actions and locally, with zero success.

The error I'm getting during the nitro build is this:

...
Error:  [nitro] RollupError: Unexpected token `production`. Expected identifier in /home/runner/work/roundup-games/roundup-games/node_modules/.pnpm/vite@6.3.5_@types+node@24.0.4_jiti@2.4.2_lightningcss@1.30.1_terser@5.43.1_tsx@4.20.3/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js
15104:   if (optimizerContext.cancelled) return { context: void 0, idToExports };
15105:   const define = {
15106:     ""production"": environment.config.keepProcessEnv ? (
             ^
15107:       // define "production" even for keepProcessEnv === true
15108:       // as esbuild will replace it automatically when `platform` is `'browser'`
error during build:
RollupError: Unexpected token `production`. Expected identifier in /home/runner/work/roundup-games/roundup-games/node_modules/.pnpm/vite@6.3.5_@types+node@24.0.4_jiti@2.4.2_lightningcss@1.30.1_terser@5.43.1_tsx@4.20.3/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js
...

The vite build until nitro passes, .output/public gets generated.
Was this page helpful?