Skip to content

ERR_MODULE_NOT_FOUND: better-auth/schema.postgresql.ts not resolved on Vercel #100

@adamkasper

Description

@adamkasper

Hey, have you already tested this module on Vercel? I'd like to migrate from Cloudflare Workers (where it works fine), but on Vercel I'm running into this error.

Build is fine, but the issue occurs after deployment — the whole app crashes because of this.

repro: https://github.com/adamkasper/nuxt-better-auth-vercel-repro

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/vercel/path0/node_modules/.cache/nuxt/.nuxt/better-auth/schema.postgresql.ts' imported from /var/task/node_modules/@nuxthub/db/schema.mjs
    at finalizeResolution (node:internal/modules/esm/resolve:280:11)
    at moduleResolve (node:internal/modules/esm/resolve:865:10)
    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:989:14)
    at defaultResolve (node:internal/modules/esm/resolve:1032:79)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:731:20)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:310:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:182:49)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///vercel/path0/node_modules/.cache/nuxt/.nuxt/better-auth/schema.postgresql.ts'
}
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions