Skip to content

Amplify outputs could not be generated. [ZodError] #14403

@anni1236012

Description

@anni1236012

How did you install the Amplify CLI?

npm create amplify@latest

If applicable, what version of Node.js are you using?

20.9.0

Amplify CLI Version

^1.8.1

What operating system are you using?

Ubuntu

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made.

Describe the bug

I am using default AWS Amplify GEN2 todo schema template. Sandbox is created but it failed to generate amplify_outputs.json file.

Expected behavior

generate amplify_outputs.json file.

Reproduction steps

  1. npx ampx sandbox --debug

Project Identifier

amplify diagnose --send-report

Learn more at https://docs.amplify.aws/cli/reference/diagnose/
⠋ Creating Zip
No Amplify backend project files detected within this folder.
✖ Creating Zip

Log output

npx ampx sandbox --debug

1:08:10 PM [deploy: CDK_TOOLKIT_I5001] 1:08:10 PM Total time: 103.2s {
  "duration": 103197
}
1:08:10 PM [Sandbox] Deployment successful
1:08:10 PM [Sandbox] Watching for file changes...
Amplify outputs could not be generated. [ZodError] [
  {
    "code": "invalid_key",
    "origin": "record",
    "issues": [
      {
        "expected": "object",
        "code": "invalid_type",
        "path": [],
        "message": "Invalid input: expected object, received string"
      }
    ],
    "path": [
      "AWS::Amplify::Platform"
    ],
    "message": "Invalid key in record"
  },
  {
    "code": "invalid_key",
    "origin": "record",
    "issues": [
      {
        "expected": "object",
        "code": "invalid_type",
        "path": [],
        "message": "Invalid input: expected object, received string"
      }
    ],
    "path": [
      "AWS::Amplify::GraphQL"
    ],
    "message": "Invalid key in record"
  },
  {
    "code": "invalid_key",
    "origin": "record",
    "issues": [
      {
        "expected": "object",
        "code": "invalid_type",
        "path": [],
        "message": "Invalid input: expected object, received string"
      }
    ],
    "path": [
      "AWS::Amplify::Auth"
    ],
    "message": "Invalid key in record"
  }
]

Additional information

package.json file

{
  "name": "iframe-comm",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "scan:templates": "tsx scripts/scan-templates.ts",
    "generate:versions": "tsx scripts/generate-versions.ts",
    "build:hmr": "NODE_ENV=development tsx scripts/build-iframe-esbuild.ts",
    "build:hmr:prod": "NODE_ENV=production tsx scripts/build-iframe-esbuild.ts",
    "dev": "yarn scan:templates && yarn generate:versions && yarn build:hmr && next dev --turbopack",
    "build": "yarn scan:templates && yarn generate:versions && yarn build:hmr:prod && next build --turbopack",
    "build:ci": "yarn test:ci && yarn build",
    "start": "next start",
    "lint": "eslint",
  },
  "dependencies": {
    "@babel/generator": "^7.28.3",
    "@babel/parser": "^7.28.4",
    "@babel/standalone": "^7.28.4",
    "@babel/traverse": "^7.28.4",
    "@babel/types": "^7.28.4",
    "@dnd-kit/core": "^6.3.1",
    "@dnd-kit/modifiers": "^9.0.0",
    "@dnd-kit/sortable": "^10.0.0",
    "@hookform/resolvers": "^5.2.2",
    "@radix-ui/react-accordion": "^1.2.12",
    "@radix-ui/react-alert-dialog": "^1.1.15",
    "@radix-ui/react-aspect-ratio": "^1.1.7",
    "@radix-ui/react-avatar": "^1.1.10",
    "@radix-ui/react-checkbox": "^1.3.3",
    "@radix-ui/react-collapsible": "^1.1.12",
    "@radix-ui/react-context-menu": "^2.2.16",
    "@radix-ui/react-dialog": "^1.1.15",
    "@radix-ui/react-dropdown-menu": "^2.1.16",
    "@radix-ui/react-hover-card": "^1.1.15",
    "@radix-ui/react-label": "^2.1.7",
    "@radix-ui/react-menubar": "^1.1.16",
    "@radix-ui/react-navigation-menu": "^1.2.14",
    "@radix-ui/react-popover": "^1.1.15",
    "@radix-ui/react-progress": "^1.1.7",
    "@radix-ui/react-radio-group": "^1.3.8",
    "@radix-ui/react-scroll-area": "^1.2.10",
    "@radix-ui/react-select": "^2.2.6",
    "@radix-ui/react-separator": "^1.1.7",
    "@radix-ui/react-slider": "^1.3.6",
    "@radix-ui/react-slot": "^1.2.3",
    "@radix-ui/react-switch": "^1.2.6",
    "@radix-ui/react-tabs": "^1.1.13",
    "@radix-ui/react-toast": "^1.2.15",
    "@radix-ui/react-toggle": "^1.1.10",
    "@radix-ui/react-toggle-group": "^1.1.11",
    "@radix-ui/react-tooltip": "^1.2.8",
    "@tabler/icons-react": "^3.29.0",
    "@tanstack/react-virtual": "^3.13.12",
    "@tsparticles/engine": "^3.9.1",
    "@tsparticles/react": "^3.0.0",
    "@tsparticles/slim": "^3.9.1",
    "@types/three": "^0.174.0",
    "aws-amplify": "^6.15.9",
    "class-variance-authority": "^0.7.1",
    "clsx": "^2.1.1",
    "cmdk": "^1.1.1",
    "cobe": "^0.6.5",
    "culori": "^4.0.2",
    "date-fns": "^4.1.0",
    "dotted-map": "^2.2.3",
    "embla-carousel-react": "^8.6.0",
    "esbuild-wasm": "0.20.2",
    "idb": "^8.0.3",
    "immer": "^10.1.3",
    "input-otp": "^1.4.2",
    "lucide-react": "^0.544.0",
    "motion": "^12.23.22",
    "next": "15.5.4",
    "next-themes": "^0.4.6",
    "react": "19.1.0",
    "react-colorful": "^5.6.1",
    "react-day-picker": "^9.11.0",
    "react-dom": "19.1.0",
    "react-hook-form": "^7.63.0",
    "react-resizable-panels": "^3.0.6",
    "react-syntax-highlighter": "^15.6.6",
    "recharts": "2.15.4",
    "simplex-noise": "^4.0.3",
    "sonner": "^2.0.7",
    "tailwind-merge": "^3.3.1",
    "tailwindcss-animate": "^1.0.7",
    "three": "^0.180.0",
    "tw-animate-css": "^1.4.0",
    "vaul": "^1.1.2",
    "zod": "^4.1.11",
    "zustand": "^5.0.8"
  },
  "devDependencies": {
    "@aws-amplify/backend": "^1.19.0",
    "@aws-amplify/backend-cli": "^1.8.1",
    "@babel/core": "^7.28.4",
    "@babel/preset-typescript": "^7.27.1",
    "@eslint/eslintrc": "^3",
    "@playwright/test": "^1.55.1",
    "@tailwindcss/postcss": "^4",
    "@testing-library/jest-dom": "^6.9.1",
    "@testing-library/react": "^16.3.0",
    "@testing-library/user-event": "^14.6.1",
    "@types/babel__core": "^7.20.5",
    "@types/babel__generator": "^7.27.0",
    "@types/babel__traverse": "^7.28.0",
    "@types/culori": "^4.0.1",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "@types/react-syntax-highlighter": "^15.5.13",
    "@vitest/ui": "2.1.8",
    "aws-cdk-lib": "^2.216.0",
    "babel-plugin-react-compiler": "^1.0.0",
    "constructs": "^10.4.4",
    "esbuild": "^0.25.12",
    "eslint": "^9",
    "eslint-config-next": "15.5.4",
    "glob": "^11.0.3",
    "happy-dom": "^19.0.2",
    "javascript-obfuscator": "^4.1.1",
    "playwright": "^1.55.1",
    "sharp": "^0.34.4",
    "tailwindcss": "^4",
    "terser": "^5.44.0",
    "tsx": "^4.21.0",
    "typescript": "^5.9.3",
    "vitest": "2.1.8"
  }
}

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions