payload icon indicating copy to clipboard operation
payload copied to clipboard

Trying to create new app but getting type "serial" does not exist on startup

Open brynshanahan opened this issue 11 months ago • 2 comments

Link to reproduction

https://github.com/brynshanahan/brynshanahan-com

Describe the Bug

When trying to start a new app with Postgres + Docker I am getting unhandledRejection error: type "serial" does not exist.

I'm starting the database in docker and I am running payload from WSL

image

To Reproduce

I dont think I've modified anything from the starter template

Payload Version

2.11.2

Adapters and Plugins

db-postgres, bundler-webpack

brynshanahan avatar Mar 08 '24 07:03 brynshanahan

@brynshanahan It seems like your DATABASE_URI is not defined ?

The error code 42704 indicates that there is an undefined object definition somewhere. image

fofoy avatar Mar 18 '24 08:03 fofoy

@fofoy I'm getting this too; I'll trying to connect to a Xata database - the tables have been created in Xata but I get the following stack tract

 ⨯ Internal error: error: type "serial" does not exist
    at /<root>/node_modules/pg-pool/index.js:45:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async DrizzleORMPgClient.query (/<root>/node_modules/drizzle-kit/payload.js:34498:21)
    at async apply (/<root>/node_modules/drizzle-kit/payload.js:36648:9)
    at async pushDevSchema (../../node_modules/@payloadcms/db-postgres/dist/utilities/pushDevSchema.js:47:5)
    at async Object.connect (../../node_modules/@payloadcms/db-postgres/dist/connect.js:84:5)
    at async BasePayload.init (../../node_modules/payload/dist/index.js:215:13)
digest: "1337719887"
 ⨯ Internal error: error: type "serial" does not exist
    at /<root>/node_modules/pg-pool/index.js:45:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async DrizzleORMPgClient.query (/<root>/node_modules/drizzle-kit/payload.js:34498:21)
    at async apply (/<root>/node_modules/drizzle-kit/payload.js:36648:9)
    at async pushDevSchema (../../node_modules/@payloadcms/db-postgres/dist/utilities/pushDevSchema.js:47:5)
    at async Object.connect (../../node_modules/@payloadcms/db-postgres/dist/connect.js:84:5)
    at async BasePayload.init (../../node_modules/payload/dist/index.js:215:13)
digest: "1337719887"
 ⨯ Internal error: error: type "serial" does not exist
    at /<root>/node_modules/pg-pool/index.js:45:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async DrizzleORMPgClient.query (/<root>/node_modules/drizzle-kit/payload.js:34498:21)
    at async apply (/<root>/node_modules/drizzle-kit/payload.js:36648:9)
    at async pushDevSchema (../../node_modules/@payloadcms/db-postgres/dist/utilities/pushDevSchema.js:47:5)
    at async Object.connect (../../node_modules/@payloadcms/db-postgres/dist/connect.js:84:5)
    at async BasePayload.init (../../node_modules/payload/dist/index.js:215:13)

j-mcgregor avatar Apr 30 '24 15:04 j-mcgregor

Hey @brynshanahan, @fofoy is probably right, you didn't configure your .env with DATABASE_URI and so it's undefined from your screenshot. image

If you can reproduce it on the latest beta we can look again, closing.

r1tsuu avatar Aug 30 '24 23:08 r1tsuu

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Sep 06 '24 20:09 github-actions[bot]