Skip to content

Amplify: Cannot find entry file when calling addBranch with asset #28764

Closed
@brettstack

Description

Describe the bug

I thought #28658 was meant to fix this, but after upgrading to the latest version released today I'm still getting this error.

Expected Behavior

Branch is created and asset is deployed.

Current Behavior

Errors with:

Error: Cannot find entry file at /Users/brett/projects/codegenie/packages/cdk/node_modules/@aws-cdk/custom-resource-handlers/dist/aws-amplify-alpha/asset-deployment-handler/index.js
    at findEntry (/Users/brett/projects/codegenie/packages/cdk/node_modules/aws-cdk-lib/aws-lambda-nodejs/lib/function.js:1:3405)
    at new NodejsFunction (/Users/brett/projects/codegenie/packages/cdk/node_modules/aws-cdk-lib/aws-lambda-nodejs/lib/function.js:1:1391)
    at new AmplifyAssetDeploymentProvider (/Users/brett/projects/codegenie/packages/cdk/node_modules/@aws-cdk/aws-amplify-alpha/lib/branch.ts:253:24)
    at Function.getOrCreate (/Users/brett/projects/codegenie/packages/cdk/node_modules/@aws-cdk/aws-amplify-alpha/lib/branch.ts:223:82)
    at new Branch (/Users/brett/projects/codegenie/packages/cdk/node_modules/@aws-cdk/aws-amplify-alpha/lib/branch.ts:190:54)
    at App.addBranch (/Users/brett/projects/codegenie/packages/cdk/node_modules/@aws-cdk/aws-amplify-alpha/lib/app.ts:303:12)
    at new WebApp (/Users/brett/projects/codegenie/packages/cdk/lib/constructs/WebApp.ts:52:31)
    at new CodeGenieStack (/Users/brett/projects/codegenie/packages/cdk/lib/cdk-stack.ts:44:5)
    at Object.<anonymous> (/Users/brett/projects/codegenie/packages/cdk/bin/cdk.ts:13:1)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)

Reproduction Steps

const packagedWebAppAsset = new Asset(this, 'PackagedAsset', {
  path: path.join(uiPackagePath, 'out'),
})
const branch = amplifyApp.addBranch(envName, {
  asset: packagedWebAppAsset,
  autoBuild: false,
})

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.122.0, "@aws-cdk/aws-amplify-alpha": "2.122.0-alpha.0"

Framework Version

No response

Node.js Version

20

OS

Mac

Language

TypeScript

Language Version

No response

Other information

No response

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