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
I can provide a minimal repro + patched repro pair (nuxthub-{issue} / nuxthub-{issue}-fix) in a follow-up comment/PR.
Summary
When schema paths come from module hooks and resolve under
node_modules/.cache/nuxt/.nuxt/..., the generated@nuxthub/db/schema.mjscan end up as: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 usesskipNodeModulesBundle: true, so schema sources undernode_modulesare 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.tsRelated
ERR_MODULE_NOT_FOUND: better-auth/schema.postgresql.ts not resolved on Vercel nuxt-modules/better-auth#100I can provide a minimal repro + patched repro pair (
nuxthub-{issue}/nuxthub-{issue}-fix) in a follow-up comment/PR.