Skip to content
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

Leftover '@ai-sdk/provider@0.0.11' after installing @ai-sdk/anthropic@latest in certain environments #2537

Open
jb-dev1 opened this issue Aug 3, 2024 · 0 comments
Labels

Comments

@jb-dev1
Copy link

jb-dev1 commented Aug 3, 2024

Description

I get a leftover stale dependency @ai-sdk/provider@0.0.11 in pnpm-lock.yaml when setting up vercel/ai-chatbot with the new pnpm 9.6.0. After installing @ai-sdk/anthropic@latest after a fresh clone of ai-chatbot and attempting to use experimental_createProviderRegistry with anthropic, it fails on build due to the stale provider@0.0.11.

This happens with the base ai-chatbot (commit b38c49d, 1 Aug) with no modifications and running pnpm install on the latest code without installing anthropic, then running pnpm add @ai-sdk/anthropic@latest. However, by initially upgrading @ai-sdk/openai@latest right after a fresh clone of ai-chatbot, it clears the stale provider@0.0.11.

I assume this would happen to any other code with the same dependency state as ai-chatbot.

Code example

import { anthropic } from '@ai-sdk/anthropic';
import { createOpenAI } from '@ai-sdk/openai';
import { experimental_createProviderRegistry as createProviderRegistry } from 'ai';

export const registry = createProviderRegistry({

  // issue shows here
  anthropic,

  openai: createOpenAI({
    apiKey: process.env.OPENAI_API_KEY,
  }),
});

Example workaround until solved (using pnpm 9.6.0)

  1. clone ai-chatbot
  2. delete pnpm-lock.yaml
  3. pnpm install
  4. pnpm update @ai-sdk/openai@latest (clears the stale provider@0.0.11)
  5. and then if you want it: pnpm add @ai-sdk/anthropic@latest

The stale provider@0.0.11 will be removed from pnpm-lock.yaml, and anthropic will not throw a provider error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants