Skip to content

PostgresError: relation "User" does not exist #50

@mzavattaro

Description

@mzavattaro

I created a new project using this as the template but ran into an issue when creating a new user. It throws the error PostgresError: relation "User" does not exist. I've tried different variants of environmental variable files but none of them work:

  • .env
  • .env.local
  • .env.development.local

My understanding is that it should be generating the User table on first user creation but it doesn't?

I've referenced the documentation here to no success:
https://vercel.com/docs/storage/vercel-postgres/quickstart

Am I missing something?

next dev --turbo

   ▲ Next.js 14.0.4 (turbo)
   - Local:        http://localhost:3000
   - Environments: .env.development.local

 ✓ Ready in 858ms
 ○ Compiling /register ...
 ✓ Compiled /register in 1061ms
 ✓ Compiled /favicon.ico in 80ms
   Reload env: .env.local
 ⨯ node_modules/.pnpm/[email protected]/node_modules/postgres/src/connection.js (794:18) @ ErrorResponse
 ⨯ PostgresError: relation "User" does not exist
    at ErrorResponse (/Users/michaelzavattaro/Developer/Github/chronopass-ai/.next/server/chunks/node_modules_34cec9._.js:2844:224)
    at handle (/Users/michaelzavattaro/Developer/Github/chronopass-ai/.next/server/chunks/node_modules_34cec9._.js:2644:728)
    at TLSSocket.data (/Users/michaelzavattaro/Developer/Github/chronopass-ai/.next/server/chunks/node_modules_34cec9._.js:2530:17)
    at TLSSocket.emit (node:events:519:28)
null
   Reload env: .env
 ⨯ node_modules/.pnpm/[email protected]/node_modules/postgres/src/connection.js (794:18) @ ErrorResponse
 ⨯ PostgresError: relation "User" does not exist
    at ErrorResponse (/Users/michaelzavattaro/Developer/Github/chronopass-ai/.next/server/chunks/node_modules_34cec9._.js:2844:224)
    at handle (/Users/michaelzavattaro/Developer/Github/chronopass-ai/.next/server/chunks/node_modules_34cec9._.js:2644:728)
    at TLSSocket.data (/Users/michaelzavattaro/Developer/Github/chronopass-ai/.next/server/chunks/node_modules_34cec9._.js:2530:17)
    at TLSSocket.emit (node:events:519:28)
null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions