-
Notifications
You must be signed in to change notification settings - Fork 108
db schema export points to node_modules/.cache path and breaks runtime #832
Copy link
Copy link
Closed
Description
Summary
When schema paths come from module hooks and resolve under node_modules/.cache/nuxt/.nuxt/..., the generated @nuxthub/db/schema.mjs can end up as:
export * from "/abs/path/node_modules/.cache/nuxt/.nuxt/better-auth/schema.postgresql.ts"This absolute cache path is then copied into build output and can fail at runtime (ERR_MODULE_NOT_FOUND) when that cache path is unavailable in deployment environments (e.g. Vercel).
Why this happens
buildDatabaseSchema() currently uses skipNodeModulesBundle: true, so schema sources under node_modules are left as external exports instead of being bundled.
Observed failure
Runtime error points to a missing file like:
.../node_modules/.cache/nuxt/.nuxt/better-auth/schema.postgresql.ts
Related
- Better Auth report:
ERR_MODULE_NOT_FOUND: better-auth/schema.postgresql.ts not resolved on Vercel nuxt-modules/better-auth#100
I can provide a minimal repro + patched repro pair (nuxthub-{issue} / nuxthub-{issue}-fix) in a follow-up comment/PR.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels