After deploying a app with Next.js & AI SDK, streaming response occured "Unhandled Promise Rejection: Error: Connection closed." #66927
-
I write an App using Next.js & AI SDK, the details as following:
I have a OpenAI assistan which it will return a long response. I upgraded from Hobby to Pro, and added the following configuation(accorging to https://sdk.vercel.ai/docs/troubleshooting/common-issues/streaming-not-working-on-vercel-pages-router) in my actions file:
Like AI SDK Demo, the action defained out of the "src/app/api? directory but "src/actions/server/chat.tsx", and it can not work! How can I do ? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
BTW, it is the log message of project's dashboard, it is the deafault max duration of Pro. |
Beta Was this translation helpful? Give feedback.
-
Solved! Using https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config , export const maxDuration = 5 ![]() |
Beta Was this translation helpful? Give feedback.
Solved!
Using https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config ,