Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(amplify): addBranch fails synth with "cannot find entry file..." (#…
…28658) Error: ```bash Error: Cannot find entry file at /node_modules/@aws-cdk/custom-resource-handlers/dist/ aws-amplify-alpha/asset-deployment-handler/index.js ``` In #27955, we migrated the aws-amplify-alpha custom resource to `@aws-cdk/custom-resource-handlers`, our internal package for storing all custom resources. However, this migration was half-baked. The reason is because we seem to have depended on our `@aws-cdk/custom-resource-handlers` package directly. That works locally, as we have `custom-resource-handlers` readily available. ``` |-- @aws-cdk |-- aws-amplify-alpha |-- custom-resource-handlers ``` `aws-amplify-alpha` directly went into `custom-resource-handlers` to grab the necessary entry file. This works locally, because we have access to all folders with impunity. Of course, when packaged and published, we publish only `aws-amplify-alpha` with no other outside folders: ``` |-- @aws-cdk |-- aws-amplify-alpha ``` Thus, the published module would not have access to the file under `custom-resource-handlers`, and predictably fails at synth time. In `aws-cdk-lib`, we airlift the necessary files _into_ the package and release it alongside `aws-cdk-lib`: ``` |-- aws-cdk-lib |-- aws-synthetics |-- custom-resource-handlers/dist/aws-synthetics/custom-resource-handler // this was airlifted into aws-cdk-lib ``` We are supposed to do the same airlift mechanism for `aws-amplify-alpha` but somehow that was forgotten. This PR adds in the necessary structure, so now `aws-amplify-alpha` looks like this: ``` |-- @aws-cdk |-- aws-amplify-alpha |-- custom-resource-handlers/dist/aws-amplify-alpha // airlifted in via this PR |-- custom-resource-handlers/dist |-- aws-amplify-alpha ``` (please excuse my horrible ascii notation) Fixes #28633. Fixes #28089. I tested my locally packaged `aws-amplify-alpha` on a local CDK app to confirm that the necessary structure exists in the packaged module. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information