Open steveoOn opened 1 week ago
Thanks for the bug report! Which Next.js version are you using?
Thanks for the bug report! Which Next.js version are you using?
"next": "14.2.4"
"react": "18.3.1"
"react-dom": "18.3.1"
"eslint": "8.43.0"
"eslint-config-next": "14.2.4"
"@types/node": "20.3.1"
"@types/react": "18.2.13"
"@types/react-dom": "18.2.6"
I'm more than happy to offer further information if needed~
My suspicion is that the issue was caused by https://github.com/vercel/ai/pull/1825#issuecomment-2185983369 (which was required unfortunately, and a correct fix is currently blocked by nextjs/react capabilities).
The library downgrade issue is a side effect of introducing request headers, which required a change to the provider interfaces.
So unfortunately there is no solution, bc reverting would mean re-introducing the other bugs.
My suspicion is that the issue was caused by #1825 (comment) (which was required unfortunately, and a correct fix is currently blocked by nextjs/react capabilities).
The library downgrade issue is a side effect of introducing request headers, which required a change to the provider interfaces.
So unfortunately there is no solution, bc reverting would mean re-introducing the other bugs.
Does this mean that in the current latest version, we cannot use the createStreamableUI
method to update UI within StreamUI
? If so, is there any recommended workaround or alternative approach for updating the UI in real-time when using the latest version of the SDK in a production environment on Vercel Edge Runtime?
Not sure if it's the same cause, but experiencing the same symptoms.
However probably of note, I'm deploying via firebase-tools onto a Google cloud function.
I cannot use createStreamableUI
or async generator functions to stream a tool response in a streamUI
call after deploying. Things work perfectly fine with next dev
. No error is reported in server logs.
This is still shown as valid in the docs https://sdk.vercel.ai/docs/ai-sdk-rsc/streaming-react-components
Also, downgrading ai
package to 3.1.32 did not help for me.
I think I have same issue, next dev working fine on local environment but somehow
generator function and initial Loading component from streamUI
is not working on Vercel PRD
it did not work on vercel PRD and same branch on netlify works as below
"@ai-sdk/openai": "^0.0.33",
"ai": "^3.2.7",
downgrade did not work tho.
Description
After upgrading the AI SDK to version 3.2.14, an issue occurs when using the
streamUI
function withtools.generate
. Specifically, when creatingcreateStreamableUI
and using itsupdate
method to refresh the UI within the function, the page does not update as expected, even though the data is successfully fetched on the server side.Importantly, this issue does not manifest in the development environment (running with
pnpm dev
onlocalhost:3000
). However, when deployed to Vercel (Edge Runtime) in the production environment, the problem becomes apparent. The server-side logic executes correctly, and responses are returned normally, but the UI fails to update. There are no error logs visible.Downgrading to AI SDK version 3.1.32 resolves the issue in the production environment.
Additionally, there's a minor compatibility issue between AI SDK version 3.1.32 and the latest @ai-sdk/anthropic version 0.0.27. When creating an Anthropic instance and passing the
model
parameter instreamText
, a type incompatibility error is thrown. This is resolved by upgrading to AI SDK 3.2.14, but introduces the aforementioned UI update problem.Code example
Additional context
"ai": "^3.1.32"
"@ai-sdk/anthropic": "^0.0.24"
"@ai-sdk/openai": "^0.0.29"
The ideal solution would be to use the latest versions of all dependencies without encountering these issues.