#pages/api prisma not defined when it takes too long to return data.
12 messages · Page 1 of 1 (latest)
Can you show how you're importing prisma? Your imports are just cut off from the screenshot @worn wharf
You know I fixed it by importing prisma at the top. Do you have any idea why it was working locally without importing prisma
Do you have a reference for how I’m suppose to initialize my prisma client in my api folder and how I’m suppose to pass it to each file
Worth a read of the whole page but, specific section is ```Prevent hot reloading from creating new instances of PrismaClient
Thank you 🙏
🙏
If u have any extra time I would love ur opinion on this. When the api is hit it instantly sends a response but on the backend I’m recursively fetching how could I send a res each time I hit the api so that I can provide the page number the server is currently at making like a loading bar
Also is there a way I could make this fetch happen any faster maybe by starting another fetch at the last page of comments and then merging them in the database
Apologies sir, but I do not know