Next.js Discord

Discord Forum

ChatGPT clone problems | Vercel, NextJS, OpenAI

Unanswered
Tomistoma posted this in #help-forum
Open in Discord
TomistomaOP
Hey I am having some problems with Vercel and NextJS. I am making a ChatGPT clone but when I send a request from the frontend to the backend, and I don't get a response back in a few seconds I get back an error even though the message is processed. I know the message was sent and processed because when I refresh the page the message and the answer from the AI are there. The problem is that instead of a response I am getting an error.

It's so unrealiable in fact that it sometimes works and sometimes doesn't
Any idea why that may be the case?

Here's the most important parts of my code:
https://pastebin.com/AE3pkxp9

My tech stack:
- Vercel
- MongoDB
- NextJS (obviously)
- Clerk
- Typescript
(can't think of anything else atm)

1 Reply

TomistomaOP
anyone?