- Directory Flattening: The frontend files (
package.json,vite.config.ts, and the Reactsrc/directory) are currently sitting in the root directory of the repository. Vercel's configuration (vercel.json) expects them to be in afrontend/directory. - TanStack Router Splitting: Vercel fails with
ENOENTduring thetsr-split=componentphase because the imports for files likesettings-storelack explicit extensions (.ts/.tsx). In strict ESM environments, extension-less imports fail during virtual file compilation.
Move all frontend configuration and source files from the root into a dedicated frontend/ directory.
mkdir -p frontend/src- Move the frontend source files:
mv src/components src/hooks src/lib src/routes src/router.tsx src/routeTree.gen.ts src/styles.css frontend/src/ - Move frontend configs:
mv package.json package-lock.json vite.config.ts tsconfig.json components.json eslint.config.js bun.lockb bunfig.toml wrangler.jsonc node_modules frontend/
Run a script to update all internal imports within frontend/src/ to include .ts or .tsx extensions.
- Check
frontend/src/routes/index.tsxand ensureimport { useSettings } from "@/lib/settings-store";becomesimport { useSettings } from "@/lib/settings-store.ts";. - Do the same for
api-client.ts,session-logs.ts,types.ts, and alluianddashboardcomponents.
- Run
cd frontend && npm run buildto verify the Vite build completes with zero errors. - Commit and push the fixes.