-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in implementing in nodejs #2213
Comments
Can you please share your typescript version as well? Updating it may resolve this |
my ts version is "typescript": "^5.1.6" and tsconfig.json file :- |
Can you share a github repository with a minimal reproduction? I can't reproduce the issue |
good to see response from you... here is my repo i have used turbo monorepo i have been trying to implement ai in backend.... for security reason i have removed my frontend folder also i switch to goggle provider but same error /../node_modules/@ai-sdk/provider-utils/dist/index.d.ts(134,5): error TS2502: 'fetch' is referenced directly or indirectly in its own type annotation. |
@KrishnaCodez i tried your example, but i can't run yarn or another package manager successfully bc it fails to find |
Encountered the same issue. Adding latest Don't have proper time now to bisect where this started happening, however @lgrammel seems that the Vercel AI SDK takes a peer dependency on types from openai even for things that don't require OAI integration ( |
For me updating ts config file solved my problem. here's what i updated: // apps/backend/tsconfig.json |
Description
Hi Vercel,
I'm trying to implement AI in my Node.js application, i copy paste the code that is available doc but I'm encountering an error. I'd appreciate some assistance in troubleshooting.
The error message I'm getting is:-
Code example
node_modules/@ai-sdk/ui-utils/node_modules/@ai-sdk/provider-utils/dist/index.d.ts(134,5): error TS2502: 'fetch' is referenced directly or indirectly in its own type annotation.
[0] node_modules/@ai-sdk/ui-utils/node_modules/@ai-sdk/provider-utils/dist/index.d.ts(149,5): error TS2502: 'fetch' is referenced directly or indirectly in its own type annotation.
[0] node_modules/ai/dist/index.d.ts(8,33): error TS2307: Cannot find module 'openai/lib/AssistantStream' or its corresponding type declarations.
[0] node_modules/ai/dist/index.d.ts(9,21): error TS2307: Cannot find module 'openai/resources/beta/threads/runs/runs' or its corresponding type declarations.
Additional context
node version v20.14.0
The text was updated successfully, but these errors were encountered: