#pages/api prisma not defined when it takes too long to return data.

12 messages · Page 1 of 1 (latest)

worn wharf
#

when i am running my code on my machine i am hitting the route with the handleData function on the right. it works just fine like this but when i deploy to vercel i get this error in console. it says prisma is not defined.

old acorn
#

Can you show how you're importing prisma? Your imports are just cut off from the screenshot @worn wharf

worn wharf
worn wharf
old acorn
#

Worth a read of the whole page but, specific section is ```Prevent hot reloading from creating new instances of PrismaClient

old acorn
#

🙏

worn wharf
# old acorn 🙏

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

old acorn
#

Apologies sir, but I do not know