Leftover '@ai-sdk/[email protected]' after installing @ai-sdk/anthropic@latest in certain environments
Description
I get a leftover stale dependency @ai-sdk/[email protected] 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 [email protected].
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 [email protected].
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)
- clone ai-chatbot
- delete pnpm-lock.yaml
- pnpm install
- pnpm update @ai-sdk/openai@latest (clears the stale [email protected])
- and then if you want it: pnpm add @ai-sdk/anthropic@latest
The stale [email protected] will be removed from pnpm-lock.yaml, and anthropic will not throw a provider error.