got an error with prisma
anyone got following error and how could i fix it?
[ Server ] Error:
Invalid prisma.chat.create() invocation:
error: Environment variable not found: DATABASE_URL. --> schema.prisma:7 | 6 | provider = "postgresql" 7 | url = env("DATABASE_URL") |
Validation Error Count: 1
I think you have to provide DATABASE_URL in env file with your postgresql database url
Yes, provide a DATABASE_URL in your .env file and then these commands, first npx prisma migrate dev and then npx prisma generate
This worked for me.
Afterwards I had to also provide a CSB_API_KEY from codesandbox.io
Yes, provide a
DATABASE_URLin your .env file and then these commands, firstnpx prisma migrate devand thennpx prisma generateThis worked for me.
Afterwards I had to also provide a
CSB_API_KEYfrom codesandbox.io
I tried but it didn't work, I got this error: error: Error validating datasource db: the URL must start with the protocol postgresql:// or postgres://.
To use a URL with protocol prisma://, you need to either enable Accelerate or the Data Proxy.
Enable Accelerate via prisma generate --accelerate or the Data Proxy via prisma generate --data-proxy.
This is how my DATABASE_URL looks like: postgresql://postgres@localhost:5432/together
You run postgresql locally on your pc, create a database and use this URL. I had some issues getting it to run. But you can just use ChatGPT to help set it up. This is how I did it at least
issue due to prisma we now have fixed!