I have a question when building npm create solid with-prisma template.
In npm run dev, prisma with url="File:./dev.db" works fine, but when you run npm run build and start it with node.output/server/index.mjs, the path is not found.
How do I specify the path at build time?
2 Replies
I also stumbled upon this and came up with a little trick π
:
https://discord.com/channels/722131463138705510/1243486537438461952/1243486985562095677
P.S. if your prisma schema is in a subfolder, I recommend you to make the path relative to that subfolder βΊοΈ
The DATABASE_URL in .env was not read, so import dotenv from 'dotenv'
I read process.env ['DATABASE_URL'] and finally solved it. Thank you.π