Closed kevsjh closed 2 days ago
Most likely caused by upgrading nanoid to v5. I've downgraded. Please try using the updated packages when they become available.
https://github.com/vercel/ai/pull/3796
If the issue persists, pls reopen.
fixed on 4.0.2, thanks
Description
Running vercel ai sdk on Firebase function. Upgraded to v4.0 and facing esm issue
Error message below
Error [ERR_REQUIRE_ESM]: require() of ES Module .../node_modules/nanoid/non-secure/index.js from .../node_modules/@ai-sdk/provider-utils/dist/index.js not supported. Instead change the require of .../node_modules/nanoid/non-secure/index.js in .../node_modules/@ai-sdk/provider-utils/dist/index.js to a dynamic import() which is available in all CommonJS modules.
Code example
No response
AI provider
ai": "^4.0.1
Additional context
No response