DT
Drizzle Team•4mo ago
Boby

error in production, using Vercel

My app is running fine locally, I also have a local migrations folder and schema but as I have deployed my project on Vercel it's erroring out that,
error: relation "users" does not exist
at /var/task/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async tH (/var/task/.next/server/app/dev/page.js:8:33294)
at async /var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:418
at async rP (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:7978)
at async r9 (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:18:1139)
at async es (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:16:26324)
at async en.responseCache.get.routeKind (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:1026)
at async r6.renderToResponseWithComponentsImpl (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:508)
at async r6.renderPageComponent (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:5121) {
length: 104,
severity: 'ERROR',
code: '42P01',
detail: undefined,
hint: undefined,
position: '13',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '1449',
routine: 'parserOpenTable',
digest: '3801088933'
}
error: relation "users" does not exist
at /var/task/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async tH (/var/task/.next/server/app/dev/page.js:8:33294)
at async /var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:418
at async rP (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:7978)
at async r9 (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:18:1139)
at async es (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:16:26324)
at async en.responseCache.get.routeKind (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:1026)
at async r6.renderToResponseWithComponentsImpl (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:508)
at async r6.renderPageComponent (/var/task/node_modules/next/dist/compiled/next-server/server.runtime.prod.js:17:5121) {
length: 104,
severity: 'ERROR',
code: '42P01',
detail: undefined,
hint: undefined,
position: '13',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '1449',
routine: 'parserOpenTable',
digest: '3801088933'
}
I am using the Postgres docker image for my local database and I have deployed that image on Vercel and then I have connected my deployed next.js project to the Vercel db instance. I do think that I will have to add some scripts to my package.json file for the migrations in the prod but I am not able to get that https://github.com/Boby900/docker-demo
GitHub
GitHub - Boby900/docker-demo: a dashboard built with next.js, x-api...
a dashboard built with next.js, x-api, shadcn and docker-postgres. - Boby900/docker-demo
No description
No description
6 Replies
ytsruh
ytsruh•4mo ago
Vercel is a serverless platform, it doesn't support Docker/Containers. You need to deploy the container somewhere else and connect to it over HTTP from Vercel
Budi
Budi•4mo ago
I would try hosting this on Railway. They conveniently allow you to create Postgres instances next to your app.
Boby
BobyOP•4mo ago
Thanks for your time and helping me Okay, I will try to host it on Railway if I could get it all working there. Thanks, @Budi Thanks @ytsruh
Budi
Budi•4mo ago
If you sign up with this ref link I get some credits 🙂 https://railway.app?referralCode=hxCjRd
Railway
Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
Boby
BobyOP•4mo ago
Thanks. I only saw your message today. I already had a Railway account when I was trying to deploy some of my other projects.
Budi
Budi•4mo ago
No sweat. Hope you were able to figure it out.
Want results from more Discord servers?
Add your server