Skip to content

[Bug] TypeError: Cannot read properties of undefined (reading '_zod') when deploying containers (v4.31.1) #13297

@sarath-dv

Description

@sarath-dv

Issue description

Bug Description

Deploying a Fargate container service fails with internal Zod validation error.

Error

TypeError: Cannot read properties of undefined (reading '_zod')
    at Object.inst._zod.parse (/home/hello/.serverless/releases/4.31.1/engine/node_modules/zod/v4/core/schemas.js:1400:46)

Environment

  • Serverless Framework: 4.31.1
  • Node.js: 20.20.0
  • OS: Ubuntu
  • Config file: serverless.containers.yml

Config (minimal reproduction)

org: spacemonk
name: fargate
deployment:
  type: [email protected]

containers:
  service-sync:
    src: ./
    routing:
      pathPattern: /*
      pathHealthCheck: /_internal_health_check
    compute:
      type: awsFargateEcs
      awsFargateEcs:
        memory: 8192
        cpu: 1024
        scale:
          - type: desired
            desired: 2

Steps to Reproduce

  1. Create serverless.containers.yml with Fargate config
  2. Run serverless deploy --stage bbprod
  3. Error occurs during packaging

Expected Behavior

Deployment should proceed without internal Zod parsing errors.

Workaround Attempted

  • Cleared ~/.serverless cache
  • Downgraded Node from v24 to v20
  • Simplified config (removed variable interpolation)
  • None resolved the issue

Context

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions