I have a posts page that I’m trying to access but I keep getting this prisma error.
api | Error:
api | Invalid `prisma.post.findMany()` invocation:
api |
api |
api | error: Environment variable not found: DATABASE_URL.
api | --> schema.prisma:5
api | |
api | 4 | provider = "sqlite"
api | 5 | url = env("DATABASE_URL")
api | |
api |
api | Validation Error Count: 1
It looks like I get an error when I run Yarn rw studio
Here’s a video clip of what I see when I click “posts” in the UI. You’ll see that the screen quickly flashes to the default rw generated page, but then throws the error.
db contains the plumbing for the database:
… snip …
After we add our first database table there will also be a SQLite database file named dev.db and a directory called migrations created for us. migrations contains the files that act as snapshots of the database schema changing over time.
Make sure DATABASE_URL is not commented out in the envs.
@dthyresson Thanks. I didn’t have a .env.defaults file. I thought that it was typically automatically added, but maybe I missed something, or skipped a step. Adding that file and then running yarn rw db up appears to have fixed my issue. Thanks for the help.