Error validating datasource URL must start with the protocol prisma://
Hello,
I'm having this issue when deploying my Next application to Vercel. Everything works fine locally. I have triple-checked env variables on Vercel and they're the same as my env locally. I also get this error if I build the project and run prod environment locally without deploying to Vercel. Any idea what might cause this; and how to solve it?
6 Replies
@Jon Harrell Here you go, a new post, thanks for the help in advance!
Hey @Aladin El-Khalil
Are you using Prisma Accelerate?
How are you generating your PrismaClient?
Can you share your build command with us?
Hi @Nurul (Prisma)
I'm generating with the command
npx prisma generate --no-engine
My full build command on Vercel is next build && npx prisma generate --no-engine
I'm not using accelerate, it's commented out. This is my prisma client.
Can you remove the
--no-engine
flag and try again?Yes I'll try
I think that solved the problem. Why did that help @Nurul (Prisma) ?
I recall that the cli build command encourages the use of
--no-engine
in production, that's confusing then?
@Nurul (Prisma)The
--no-engine
flag generates Prisma Client without an accompanied engine for use with Prisma Accelerate. In your code, as you had commented out Accelerate extension and using a direct database connection string, the --no-engine
flag shouldn't be used.