Skip to content

VercelAI template on latest (0.31.1) fails npm run build: zod v3 pinned #2514

Open

Description

@xenity

Description

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.

Steps to Reproduce

  1. agentcore create --project-name MyVercelAgent --no-agent
  2. agentcore add agent --name VercelAgent --type create --build CodeZip --language TypeScript --framework VercelAI --model-provider Bedrock --memory none
  3. 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

Activity

  1. xenity commented on Oct 3, 2026

    @xenity
    Author

    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.

  2. dfernaro commented on Oct 4, 2026

    @dfernaro

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions