Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brettstack opened this issue Jan 18, 2024 · 1 comment · Fixed by #28772
Closed

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

brettstack opened this issue Jan 18, 2024 · 1 comment · Fixed by #28772
Labels
@aws-cdk/aws-amplify Related to AWS Amplify bug This issue is a bug.

Comments

@brettstack
Copy link
Contributor

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

@brettstack brettstack added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 18, 2024
@github-actions github-actions bot added the @aws-cdk/aws-amplify Related to AWS Amplify label Jan 18, 2024
@mergify mergify bot closed this as completed in #28772 Jan 19, 2024
mergify bot pushed a commit that referenced this issue Jan 19, 2024
…28772)

#28658 missed changing one of the paths (i.e it didn't remove the extra '..') and I was still getting the "cannot find entry file" error. I can confirm that my CDK stack works as expected after making the change locally.

This is my first CDK PR. I did the following:

```
yarn install
npx lerna run build --scope=@aws-cdk/aws-amplify-alpha
cd packages/@aws-cdk/aws-amplify-alpha
yarn build
yarn test
yarn integ-runner --update-on-failed
npx lerna run build --scope=aws-cdk-lib
```

Closes #28764

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@pahud pahud removed the needs-triage This issue or PR still needs to be triaged. label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-amplify Related to AWS Amplify bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants