deployment

anyone know how to config nodejs and ts to deploy on vercel i always fail on check because it return 500 internal error
25 Replies
Vincent Udén
Vincent Udén17mo ago
An actual error message would be helpful
chnmrn.
chnmrn.OP17mo ago
chnmrn.
chnmrn.OP17mo ago
i alr add npx prisma generate on my build script, im using prisma and put the db on elephantsql. all db username n password already correct. i presume its not create the schema table on the elephant
Vincent Udén
Vincent Udén17mo ago
How to take a screenshot
How to take a screenshot on your smartphone, tablet, notebook or desktop computer
Vincent Udén
Vincent Udén17mo ago
Have you pushed your schema to the db?
chnmrn.
chnmrn.OP17mo ago
umm tbh idk how to do that on productions but i search in chat gpt that in vercel it would automatically run the npx prisma deploy anyway my be is on vercel
chnmrn.
chnmrn.OP17mo ago
its the same
Vincent Udén
Vincent Udén17mo ago
Prisma has a pretty extensive guide on how to deploy to vercel. Don't trust chatGPT lol https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-vercel#1-create-the-project-and-deploy-to-vercel
Prisma
Deploy to Vercel
Learn how to deploy a Next.js application based on Prisma Client to Vercel.
Vincent Udén
Vincent Udén17mo ago
GitHub
GitHub - prisma/deployment-example-vercel: Prisma deployment to Ver...
Prisma deployment to Vercel example. Contribute to prisma/deployment-example-vercel development by creating an account on GitHub.
Vincent Udén
Vincent Udén17mo ago
Specifically with this package.json
{
"name": "deployment-example-prisma-vercel",
"dependencies": {
"@prisma/client": "4.16.2",
"next": "13.4.10",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"vercel-build": "prisma generate && prisma migrate deploy && next build",
"prisma:generate": "prisma generate"
},
"devDependencies": {
"prisma": "4.16.2"
}
}
{
"name": "deployment-example-prisma-vercel",
"dependencies": {
"@prisma/client": "4.16.2",
"next": "13.4.10",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"vercel-build": "prisma generate && prisma migrate deploy && next build",
"prisma:generate": "prisma generate"
},
"devDependencies": {
"prisma": "4.16.2"
}
}
Where the vercel-build step is the essential part
chnmrn.
chnmrn.OP17mo ago
kinda hard read the docs im new on productions,this is my first time xD but yea ik that gpt kinda sus from the beginning thanks ill try
Vincent Udén
Vincent Udén17mo ago
If you can enter a search into chatGPT you can do the same to google. It's literally the first result https://letmegooglethat.com/?q=prisma+vercel+deploy
LetMeGoogleThat.com
Let Me Google That
For all those people that find it more convenient to bother you with their question than to google it for themselves.
chnmrn.
chnmrn.OP17mo ago
i try prisma production but it lead me to incorrect desired ohh the problem is npx prisma migrate deploy
chnmrn.
chnmrn.OP17mo ago
i tho u can't do it on production (from chat gpt again )
Vincent Udén
Vincent Udén17mo ago
Dude, seriously, take screen shots. Dont photograph your screen And what I can see from the photo, you still havent added the "vercel-build" entry to your scripts
chnmrn.
chnmrn.OP17mo ago
chnmrn.
chnmrn.OP17mo ago
no need use npx? anyway thx for the help it's perfectly work thanks, i still confused on prisma migrate thats why i don't know which one the problem is
Vincent Udén
Vincent Udén17mo ago
prisma generate creates the typescript classes you import in your code. prisma migrate creates the tables in the database (if they don't exist) And no worries
chnmrn.
chnmrn.OP17mo ago
ahh i see i used to use db push on dev environment still new on migrate
Vincent Udén
Vincent Udén17mo ago
Here's an explanation on the differences between the two https://www.prisma.io/docs/concepts/components/prisma-migrate/db-push
Prisma
Prototype your schema
Prototype your schema
chnmrn.
chnmrn.OP17mo ago
thanks mate umm i wanna ask something again my fe not found in items/error do u know why is it
chnmrn.
chnmrn.OP17mo ago
chnmrn.
chnmrn.OP17mo ago
chnmrn.
chnmrn.OP17mo ago
on dev its work,on vercel not found
Vincent Udén
Vincent Udén17mo ago
Sorry, got no clue
Want results from more Discord servers?
Add your server