Bug Description
Deploying to Cloudflare Workers fails with No such module "db" on vinext 0.0.35 and later (tested up to 0.0.38). The same project deploys successfully on vinext 0.0.33.
Error Message
Uncaught Error: No such module "db".
This appears as a Workers validation error (error code 10021) after wrangler deploy succeeds in uploading.
Environment
- vinext: 0.0.35, 0.0.36, 0.0.37, 0.0.38 (all fail)
- vinext 0.0.33: works perfectly
- Node: 22
- wrangler: 4.73.0
- Vite: 7.1.3
- OS: Windows 10
- Platform: Cloudflare Workers with D1, R2, KV, Durable Objects
Reproduction
Project structure
db/
index.ts # exports getDb(), Database type, schema
schema.ts # Drizzle ORM schema (SQLite/D1)
lib/
cron.ts # imports from "@/db"
actions/ # server actions import from "@/db"
worker-entry.ts # custom entry (re-exports vinext + cron + Durable Object)
db/index.ts
import { drizzle } from "drizzle-orm/d1";
import * as schema from "./schema";
export function getDb(d1: D1Database) {
return drizzle(d1, { schema });
}
export type Database = ReturnType<typeof getDb>;
export { schema };
tsconfig.json paths
{
"paths": {
"@/*": ["./*"]
}
}
worker-entry.ts (custom entry for cron + Durable Objects)
export { default } from "vinext/server/app-router-entry";
export { RateLimiter } from "@/lib/rate-limiter";
import { handleCron } from "@/lib/cron";
export const scheduled = async (event: { cron: string }): Promise<void> => {
await handleCron({ cron: event.cron });
};
wrangler.jsonc
Steps to reproduce
- Create a project with a
db/ directory using @/db path alias (Drizzle ORM + D1)
- Use a custom
worker-entry.ts that imports from @/lib/cron (which transitively imports @/db)
npx vinext build succeeds on all versions
wrangler deploy succeeds on 0.0.33 but fails on 0.0.35+ with "No such module db"
Workaround
Pin to vinext 0.0.33:
npm install vinext@0.0.33
Analysis
The build step succeeds on all versions, so TypeScript compilation and bundling work fine. The error occurs at Workers runtime validation, suggesting the @/db path alias is not being resolved correctly in the final Worker bundle starting from 0.0.35.
This may be related to the "Major App Router runtime refactor" in 0.0.35 that extracted modules into smaller per-route bundles, or the tsconfig alias transform fixes mentioned in the changelog.
The custom worker-entry.ts with "main": "./worker-entry.ts" in wrangler.jsonc may be a factor, as it creates a separate entry point that needs the same path resolution as the vinext-managed entry.
Bug Description
Deploying to Cloudflare Workers fails with
No such module "db"on vinext 0.0.35 and later (tested up to 0.0.38). The same project deploys successfully on vinext 0.0.33.Error Message
This appears as a Workers validation error (error code 10021) after
wrangler deploysucceeds in uploading.Environment
Reproduction
Project structure
db/index.ts
tsconfig.json paths
{ "paths": { "@/*": ["./*"] } }worker-entry.ts (custom entry for cron + Durable Objects)
wrangler.jsonc
{ "name": "arrangelist", "compatibility_date": "2026-02-12", "compatibility_flags": ["nodejs_compat"], "main": "./worker-entry.ts", // ... D1, R2, KV, Durable Objects bindings }Steps to reproduce
db/directory using@/dbpath alias (Drizzle ORM + D1)worker-entry.tsthat imports from@/lib/cron(which transitively imports@/db)npx vinext buildsucceeds on all versionswrangler deploysucceeds on 0.0.33 but fails on 0.0.35+ with "No such module db"Workaround
Pin to vinext 0.0.33:
Analysis
The build step succeeds on all versions, so TypeScript compilation and bundling work fine. The error occurs at Workers runtime validation, suggesting the
@/dbpath alias is not being resolved correctly in the final Worker bundle starting from 0.0.35.This may be related to the "Major App Router runtime refactor" in 0.0.35 that extracted modules into smaller per-route bundles, or the tsconfig alias transform fixes mentioned in the changelog.
The custom
worker-entry.tswith"main": "./worker-entry.ts"in wrangler.jsonc may be a factor, as it creates a separate entry point that needs the same path resolution as the vinext-managed entry.