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

Missing dependency @aws-sdk/signature-v4-crt after updating to client-s3 3.33.0 #2806

Closed
birtles opened this issue Sep 21, 2021 · 9 comments · Fixed by #2814
Closed

Missing dependency @aws-sdk/signature-v4-crt after updating to client-s3 3.33.0 #2806

birtles opened this issue Sep 21, 2021 · 9 comments · Fixed by #2814
Assignees
Labels
bug This issue is a bug.

Comments

@birtles
Copy link

birtles commented Sep 21, 2021

Describe the bug

After updating to @aws-sdk/client-s3 3.33.0 from 3.32.0 I get the following error when building lambdas using NodejsFunction as part of a CDK project:

$ cdk deploy --all
Bundling asset Stack/function/Code/Stage...
 > node_modules/@aws-sdk/middleware-sdk-s3/dist/cjs/S3SignatureV4.js: error: Could not resolve "@aws-sdk/signature-v4-crt" (mark it as external to exclude it from the bundle)
    38 │ ...erV4 = (await Promise.resolve().then(() => __importStar(require("@aws-sdk/signature-v4-crt")))).CrtSignerV4;
       ╵                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 error

Your environment

SDK version number

@aws-sdk/client-s3@3.33.0

Is the issue in the browser/Node.js/ReactNative?

Node.js

Details of the browser/Node.js/ReactNative version

v14.17.5

Additional context

Presumably a regression from #2796.

Reverting to 3.32.0 fixes the issue.

cc @AllanZhengYP

@birtles birtles added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 21, 2021
@dianababurina-photobox
Copy link

Facing the same issue with serverless + webpack

@0xdeafcafe
Copy link

Same here.

@AllanZhengYP AllanZhengYP self-assigned this Sep 21, 2021
@AllanZhengYP AllanZhengYP removed the needs-triage This issue or PR still needs to be triaged. label Sep 21, 2021
@AllanZhengYP
Copy link
Contributor

AllanZhengYP commented Sep 21, 2021

Hi @birtles @dianababurina-photobox @0xdeafcafe, this is indeed a regression introduced by #2796. As it mentioned in the description, we currently don't have functional test agains esbuild used by CDK Node.js function component. We will need to enforce the test.

To workaround it, you can specify the package as external. For example:

new NodejsFunction(this, "listObjectsFunc", {
  entry: "path/to/entry",
  bundling: {
    externalModules: ["@aws-sdk/signature-v4-crt"]
  }
});

@bdo
Copy link

bdo commented Sep 22, 2021

An alternative workaround (if you actually don't need S3 Multi-region Access Point), is to entirely exclude @aws-sdk/signature-v4-crt from the bundle.

For instance with serverless-bundle:

custom:
  bundle:
    forceExclude:
      - '@aws-sdk/signature-v4-crt'

@henhal
Copy link

henhal commented Sep 23, 2021

I commented on this issue believing that it had been unfixed, but this seems to be a new issue.
#2750 (comment)

It's becoming a bad habit that about every second release is broken. :/

@AllanZhengYP
Copy link
Contributor

@henhal The incompatible issue with bundler has happened a couple of times. We are working on adding the test with popular bundlers: WebPack4, WebPack5, Rollup, EsBuild to prevent this from happening again.

@oliversalzburg
Copy link

Similarly in yarn, for additional keyword stuffing:

➤ YN0002: │ @aws-sdk/client-s3@npm:3.33.0 doesn't provide @aws-sdk/signature-v4-crt (p3df12), requested by @aws-sdk/middleware-sdk-s3
➤ YN0002: │ @aws-sdk/s3-request-presigner@npm:3.33.0 doesn't provide @aws-sdk/signature-v4-crt (p0c252), requested by @aws-sdk/middleware-sdk-s3

@oliversalzburg
Copy link

oliversalzburg commented Oct 5, 2021

@AllanZhengYP I figured this should be fixed in 3.34 now, but even installing 3.35 still raises the same peer dependency warnings.

➤ YN0000: ┌ Resolution step
Resolution step
00:05
➤ YN0002: │ @aws-sdk/client-s3@npm:3.35.0 doesn't provide @aws-sdk/signature-v4-crt (p25b82), requested by @aws-sdk/middleware-sdk-s3
➤ YN0002: │ @aws-sdk/s3-request-presigner@npm:3.35.0 doesn't provide @aws-sdk/signature-v4-crt (p225e9), requested by @aws-sdk/middleware-sdk-s3
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 4s 521ms

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants