vercel / ai

Build AI-powered applications with React, Svelte, Vue, and Solid
https://sdk.vercel.ai/docs
Other
9.4k stars 1.37k forks source link

ReferenceError: performance is not defined #2819

Closed rafalzawadzki closed 1 week ago

rafalzawadzki commented 2 weeks ago

Description

Steps to reproduce:

  1. Install latest SDK with telemetry (3.3.19)
  2. Use streamText in API route on edge in Next.js
  3. Get error ReferenceError: performance is not defined because performance is not a supported API in Edge Runtime

Expected result: ai can be used on Next.js Edge Runtime.

Temporary workaround: Downgrade to ai@3.3.10.

Code example

No response

Additional context

performance has been added in this commit: https://github.com/vercel/ai/commit/099db960d18e098ae728dce1b73fcfa6acee221e

olefirenko commented 2 weeks ago

Having the same issue.

lgrammel commented 1 week ago

Fix: https://github.com/vercel/ai/pull/2864/files

lgrammel commented 1 week ago

Fixed in ai@3.3.24