aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
89 stars 79 forks source link

Build fails in Amplify Gen 2 console but local sandbox succeeds #3056

Open vinothj-aa opened 4 days ago

vinothj-aa commented 4 days ago

Environment information

System:
  OS: macOS 14.5
  CPU: (10) arm64 Apple M1 Pro
  Memory: 109.30 MB / 16.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 22.6.0 - ~/.nvm/versions/node/v22.6.0/bin/node
  Yarn: undefined - undefined
  npm: 10.8.2 - ~/.nvm/versions/node/v22.6.0/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.3.0
  @aws-amplify/backend: 1.2.1
  @aws-amplify/backend-auth: 1.1.4
  @aws-amplify/backend-cli: 1.2.6
  @aws-amplify/backend-data: 1.1.3
  @aws-amplify/backend-deployer: 1.1.2
  @aws-amplify/backend-function: 1.4.0
  @aws-amplify/backend-output-schemas: 1.2.0
  @aws-amplify/backend-output-storage: 1.1.1
  @aws-amplify/backend-secret: 1.1.1
  @aws-amplify/backend-storage: 1.1.2
  @aws-amplify/cli-core: 1.1.2
  @aws-amplify/client-config: 1.3.0
  @aws-amplify/deployed-backend-client: 1.4.0
  @aws-amplify/form-generator: 1.0.1
  @aws-amplify/model-generator: 1.0.6
  @aws-amplify/platform-core: 1.1.0
  @aws-amplify/plugin-types: 1.2.1
  @aws-amplify/sandbox: 1.2.1
  @aws-amplify/schema-generator: 1.2.1
  aws-amplify: 6.3.7
  aws-cdk: 2.158.0
  aws-cdk-lib: 2.158.0
  typescript: 5.5.2
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Data packages

quasr-plus@0.1.0 /Users/vinothj/Code/Next Gen/quasr-plus
├─┬ @aws-amplify/backend-cli@1.2.6
│ └─┬ @aws-amplify/schema-generator@1.2.1
│   └── @aws-amplify/graphql-schema-generator@0.9.4
└─┬ @aws-amplify/backend@1.2.1
  └─┬ @aws-amplify/backend-data@1.1.3
    └── @aws-amplify/data-construct@1.10.0

Description

Bug: After I rename a custom javascript resolver, the build fails in Amplify Gen 2 console however the build & deployment are successful in local cloud sandbox environment.

Steps to reproduce:

  1. Create an additional AppSync API (as we have exceeded 1MB size limit of Amplify data stack a long time ago)
  2. Add an external DynamoDB database in backend.ts file and create a datasource for the AppSync API
  3. Add a mutation in graphql schema file
  4. Create a custom javascript resolver function and add it to backend.ts file
  5. Deploy the changes
  6. Now rename the resolver function
  7. Deploy again

This time the build fails in Amplify Gen 2 console.

image

getIncidentAndStakeholder.js is the updated resolver file name and it is available in the code repository.

palpatim commented 2 days ago

Thanks for opening this issue. We'll investigate and see what's going on.