There are a few problems with the vercelAiIntegration on Next.js. We made some improvements already (and/or they are pending):
Once all of this landed, we've done everything we can do in the SDK itself. That leaves the problem that we cannot monkey-patch ai on Next.js, for whatever reason. This PR may fix this: vercel/ai#6716 in the ai package, but this is still WIP and unclear when/how this lands.
For the time being, once all the linked PRs in the SDK are merged & released, stuff should work, if users manually enable telemetry in every call:
await generateText({
experimental_telemetry: { isEnabled: true },
// ...
});
We should probably inform users in the AI insights module that are using Next.js about this, somehow.
There are a few problems with the
vercelAiIntegrationon Next.js. We made some improvements already (and/or they are pending):vercelAiIntegrationwhenaimodule is detected #16565modulesIntegrationworks in more environments #16566vercelAiIntegration#16551Once all of this landed, we've done everything we can do in the SDK itself. That leaves the problem that we cannot monkey-patch
aion Next.js, for whatever reason. This PR may fix this: vercel/ai#6716 in the ai package, but this is still WIP and unclear when/how this lands.For the time being, once all the linked PRs in the SDK are merged & released, stuff should work, if users manually enable telemetry in every call:
We should probably inform users in the AI insights module that are using Next.js about this, somehow.