Prisma postgres DB not updating
Hello guys.
I'm working on auth for my nextjs app built with nextauth and prisma. Initially, I created the project using a local sqlite db and everything worked properly. But when I switched to a postgres db with railway.app it stopped working properly.
When I make a post request to create a new user account from Insomnia(an API Client), the db updates with the new user. But when I make that same request through the sign up form UI, the db doesn't update even after the fetch request returns an ok response.
This is my signup function:
This is my
api/user/route.ts
file:
2 Replies
It might be process.env. It is only available on the server, so you could could console.log and see what it outputs. If you want to use environment variables on the client you have to prefix with NEXT_PUBLIC.
https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#bundling-environment-variables-for-the-browser
Configuring: Environment Variables
Learn to add and access environment variables in your Next.js application.
Thank you!