Skip to content

Add missing peer dependencies#153

Open
atlekbai wants to merge 2 commits into
cloudflare:mainfrom
atlekbai:fix/missing-peer-deps
Open

Add missing peer dependencies#153
atlekbai wants to merge 2 commits into
cloudflare:mainfrom
atlekbai:fix/missing-peer-deps

Conversation

@atlekbai
Copy link
Copy Markdown

Summary

This adds the peer dependencies that the starter already relies on indirectly:

  • @babel/core for @rolldown/plugin-babel
  • @ai-sdk/provider for workers-ai-provider
  • @ai-sdk/react for @cloudflare/ai-chat/react

No source code changes are needed.

Why

I hit this from a fresh project created with the Agents starter. npm run dev failed before Vite could load the config because @rolldown/plugin-babel imports @babel/core, but the app does not declare it:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@babel/core' imported from .../node_modules/@rolldown/plugin-babel/dist/index.mjs

Once that was fixed, the Worker and client transforms also needed the AI SDK peers used by workers-ai-provider and @cloudflare/ai-chat/react.

Declaring these at the app root makes fresh installs deterministic instead of relying on where npm happens to place transitive peer dependencies.

Validation

  • npm ci
  • npm run check
  • npm run dev
  • curl -I http://127.0.0.1:5173/ returned 200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant