`.env.example` sets `NODE_ENV=development`, so local production builds return 500
Problem
.env.example sets NODE_ENV="development" (line 6). With that line in .env, bun run build succeeds, but every page of the build returns 500.
Repro
With NODE_ENV="development" in .env, as in the template:
bun run build
bunx vite preview
curl -i http://localhost:4173/
HTTP 500
Error in renderToReadableStream: TypeError: (0 , import_jsx_dev_runtime.jsxDEV) is not a function
at RootDocument (.output/server/_ssr/router-*.mjs)
Running both commands with NODE_ENV=production in the shell, which takes precedence over .env, returns 200.
Checked on main (17ade4e). Vercel builds don't read the local .env, so this affects local builds only, unless the variable was also copied into Vercel's environment settings (not checked).
Likely cause
Vite treats NODE_ENV=development in a .env file as a request for a development build, even under vite build (resolveConfig in Vite's node.js). JSX is then compiled with React's development runtime (jsxDEV). The Nitro server bundle loads React's production runtime, where jsxDEV is undefined.
Expected
A .env copied from .env.example gives working dev and production builds.
Possible fixes
- Remove
NODE_ENVfrom.env.example. Vite already sets it:developmentforvite dev,productionforvite build.src/routes/api.composio.connect.ts:43reads it and keeps working. - Existing
.envfiles copied from the template need the line deleted too.