You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VercelAI template on latest (0.31.1) fails npm run build: zod v3 pinned #2514
The VercelAI TypeScript template generated by agentcore add agent --framework VercelAI fails npm run build out of the box. src/assets/typescript/http/vercelai/base/package.json pins zod ^3.24.0, while bedrock-agentcore types expect zod v4.
The other pins in the same file are also a major version behind (ai ^6, @ai-sdk/amazon-bedrock ^4, bedrock-agentcore ^0.2.4). This file was last changed on 13 May 2026.
cd app/VercelAgent && npm install && npm run build
Expected Behavior
The generated project builds without changes.
Actual Behavior
main.ts(40,5): error TS2740: Type 'ZodObject<...>' is missing the following properties from type 'ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>': def, type, toJSONSchema, check, and 20 more.
main.ts(44,66): error TS18046: 'payload' is of type 'unknown'.
Bumping to zod ^4 makes the build pass. It also builds and runs with current versions: ai ^7.0.127, @ai-sdk/amazon-bedrock ^5.0.105, bedrock-agentcore ^0.4.5, zod ^4.6.5.
CLI Version
0.31.1
Operating System
macOS
Additional Context
model/load.ts defaults to us.anthropic.claude-sonnet-4-5-20250929-v1:0, a US-only inference profile, so the generated agent fails outside the US until edited.
Note: the rewritten template in 1.0.0-rc.5 (templates/agent-typescript-vercel) pins zod ~4.4.3, so this looks fixed there, but latest users still get the broken template. Could the zod bump ship as a 0.31.x patch, or 1.0 become latest? It would also be worth moving the 1.0 template to current majors before GA: it still pins ai ~6.0.0, @ai-sdk/amazon-bedrock ~4.0.0 and bedrock-agentcore ~0.3.0.
I can take the main fix: bump zod to ^4.4.3 and bedrock-agentcore to ^0.3.0, and switch the default Bedrock model to the global. inference profile. Those are the versions and model ID that the TypeScript Strands template on main and the 1.0 Vercel template already use. I reproduced the build error on 0.31.1, and with these changes the generated agent builds, starts and answers /ping with each model provider (Bedrock, Anthropic, OpenAI and Gemini).
I'd keep ai 6 and @ai-sdk/amazon-bedrock 4 here to match the 1.0 template; moving both templates to the current majors fits better with the 1.0 update you suggested.
Activity
xenity commentedon Oct 3, 2026
Note: the rewritten template in 1.0.0-rc.5 (templates/agent-typescript-vercel) pins zod ~4.4.3, so this looks fixed there, but latest users still get the broken template. Could the zod bump ship as a 0.31.x patch, or 1.0 become latest? It would also be worth moving the 1.0 template to current majors before GA: it still pins ai ~6.0.0, @ai-sdk/amazon-bedrock ~4.0.0 and bedrock-agentcore ~0.3.0.
dfernaro commentedon Oct 4, 2026
I can take the
mainfix: bumpzodto^4.4.3andbedrock-agentcoreto^0.3.0, and switch the default Bedrock model to theglobal.inference profile. Those are the versions and model ID that the TypeScript Strands template onmainand the 1.0 Vercel template already use. I reproduced the build error on 0.31.1, and with these changes the generated agent builds, starts and answers/pingwith each model provider (Bedrock, Anthropic, OpenAI and Gemini).I'd keep
ai6 and@ai-sdk/amazon-bedrock4 here to match the 1.0 template; moving both templates to the current majors fits better with the 1.0 update you suggested.