"module": "ESNext" and "moduleResolution": "bundler" so import attributes (islands) and .ts extensions in generated code typecheck.
tsconfig.json
tsconfig.json
src/vite-env.d.ts
.better-router is generated on vite build (route manifest). Include it if you want that file in the project; it is gitignored.
Loader and page types
There is no generated route type yet. Share a props type between the loader and the page:src/routes/projects/[id].server.tsx
src/routes/projects/[id].tsx
useLoaderData() is the source of truth. Reading both (data.name ?? name) covers both.
.server.tsx is server-only. Importing a type from it into a page is fine. Importing a value (a function, a database client) is not — that pulls server code into the client bundle.
Hono context and env
c directly as LoaderArgs.c.
Augment bindings and variables when you add Wrangler keys or middleware state:
src/env.d.ts
getEnv().DB and c.get("requestId") typecheck. See Bindings.