Environment information
System:
OS: macOS 26.5.1
CPU: (10) arm64 Apple M5
Memory: 187.42 MB / 24.00 GB
Shell: /bin/zsh
Binaries:
Node: 24.14.0 - ~/.nvm/versions/node/v24.14.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v24.14.0/bin/yarn
npm: 11.9.0 - ~/.nvm/versions/node/v24.14.0/bin/npm
pnpm: 10.33.2 - ~/.nvm/versions/node/v24.14.0/bin/pnpm
NPM Packages:
@aws-amplify/auth-construct: 1.11.2
@aws-amplify/backend: 1.23.0
@aws-amplify/backend-ai: Not Found
@aws-amplify/backend-auth: 1.9.4
@aws-amplify/backend-cli: 1.8.3
@aws-amplify/backend-data: 1.7.0
@aws-amplify/backend-function: 1.18.1
@aws-amplify/backend-output-schemas: 1.8.0
@aws-amplify/backend-output-storage: 1.3.5
@aws-amplify/backend-secret: 1.4.2
@aws-amplify/backend-storage: 1.5.0
@aws-amplify/cli-core: 2.2.5
@aws-amplify/client-config: 1.10.2
@aws-amplify/data-construct: 1.17.3
@aws-amplify/data-schema: 1.26.0
@aws-amplify/deployed-backend-client: 1.8.2
@aws-amplify/form-generator: 1.2.7
@aws-amplify/model-generator: 1.2.3
@aws-amplify/platform-core: 1.11.1
@aws-amplify/plugin-types: 1.12.1
@aws-amplify/sandbox: 2.2.1
@aws-amplify/schema-generator: 1.4.1
@aws-cdk/toolkit-lib: 1.19.0
aws-amplify: Not Found
aws-cdk-lib: 2.258.0
typescript: 6.0.3
AWS environment variables:
AWS_EC2_METADATA_DISABLED = true
No CDK environment variables
Describe the bug:
When using npx ampx sandbox, making structural changes to custom mutations in amplify/data/resource.ts (specifically renaming arguments) can cause the cloud deployment state to become permanently wedged.
When the argument is renamed and the file is saved, the Sandbox triggers a deployment that completes rapidly (~11 seconds). However, the AWS::AppSync::GraphQLSchema does not update in the cloud.
Crucially, this is not a local caching issue. Killing the sandbox process, wiping the .amplify folder, wiping node_modules/.cache, and restarting the sandbox does not fix it. The synthesizer runs, CDK completes the deployment in ~10 seconds with 0 changes detected, and the AppSync schema remains permanently stale.
The ONLY way to un-wedge the schema and get the updates to deploy is to completely tear down the cloud environment (npx ampx sandbox delete) and recreate it from scratch.
To Reproduce:
- Create a custom mutation in
amplify/data/resource.ts with a specific argument name (e.g., staleBugTest):
updateHanblueCentralDeviceShadow: a.mutation()
.arguments({ id: a.id().required(), staleBugTest: a.string().required(), state: a.json().required() })
.returns(a.ref('HanblueCentralDeviceShadow'))
.authorization(allow => [allow.authenticated()])
.handler(a.handler.custom({ dataSource: 'IoTDataEndpoint', entry: getResolver('updateDeviceShadow.js') })),
- Run
npx ampx sandbox. Allow it to deploy.
- In the code editor, revert the argument name from
staleBugTest back to shadowName. Save the file.
- If multiple rapid saves occur (triggering "Detected file changes while previous deployment was in progress"), the cloud state wedges.
- The Sandbox completes the deployment in ~11 seconds, but no
AWS::AppSync::GraphQLSchema update occurs in the logs.
- Check the AWS AppSync Console. The schema is permanently stuck expecting the old
staleBugTest argument.
- Kill the sandbox (
Ctrl+C), delete local artifacts (rm -rf .amplify), and restart npx ampx sandbox. The deployment still skips the schema update.
- Run
npx ampx sandbox delete, then npx ampx sandbox. The schema finally deploys correctly with shadowName.
Expected behavior:
CDK/CloudFormation must correctly evaluate the diff between the local resource.ts file and the deployed AppSync schema. Hotswaps or rapid saves must not permanently corrupt the state tracking of the AWS::AppSync::GraphQLSchema resource to the point where a full stack teardown is required to push a schema update.
Environment information
Describe the bug:
When using
npx ampx sandbox, making structural changes to custom mutations inamplify/data/resource.ts(specifically renaming arguments) can cause the cloud deployment state to become permanently wedged.When the argument is renamed and the file is saved, the Sandbox triggers a deployment that completes rapidly (~11 seconds). However, the
AWS::AppSync::GraphQLSchemadoes not update in the cloud.Crucially, this is not a local caching issue. Killing the sandbox process, wiping the
.amplifyfolder, wipingnode_modules/.cache, and restarting the sandbox does not fix it. The synthesizer runs, CDK completes the deployment in ~10 seconds with 0 changes detected, and the AppSync schema remains permanently stale.The ONLY way to un-wedge the schema and get the updates to deploy is to completely tear down the cloud environment (
npx ampx sandbox delete) and recreate it from scratch.To Reproduce:
amplify/data/resource.tswith a specific argument name (e.g.,staleBugTest):npx ampx sandbox. Allow it to deploy.staleBugTestback toshadowName. Save the file.AWS::AppSync::GraphQLSchemaupdate occurs in the logs.staleBugTestargument.Ctrl+C), delete local artifacts (rm -rf .amplify), and restartnpx ampx sandbox. The deployment still skips the schema update.npx ampx sandbox delete, thennpx ampx sandbox. The schema finally deploys correctly withshadowName.Expected behavior:
CDK/CloudFormation must correctly evaluate the diff between the local
resource.tsfile and the deployed AppSync schema. Hotswaps or rapid saves must not permanently corrupt the state tracking of theAWS::AppSync::GraphQLSchemaresource to the point where a full stack teardown is required to push a schema update.