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

fix webpack build error #220

Closed
wants to merge 5 commits into from
Closed

fix webpack build error #220

wants to merge 5 commits into from

Conversation

zhex900
Copy link

@zhex900 zhex900 commented Jun 4, 2021

Issue #, if available:

Description of changes:
The reason for this PR is during my electron build, webpack says the AWS CRT module is not found.

aws/aws-iot-device-sdk-js-v2#158

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

Copy link
Contributor

@bretambrose bretambrose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty substantial PR (and we definitely appreciate the work put into it) and outside my expertise. Do you have any additional suggestions for evaluating/testing/understanding the work you've done here?

@giantcow
Copy link

We might need to rebase since this PR has been open for almost a year now, but IMO the unit tests that haven't run yet should satisfy any testing requirements.

This still actively happens with [email protected] and [email protected]. My project depends on the s3 client (v3) and introduces the aws-crt dependency and webpacking issue:

# kayo @ <snip> in ~/<snip> [1:16:11] C:130
$ npm run webpack -- --stats-error-details

> [email protected] webpack
> webpack "--stats-error-details"

...

WARNING in ./node_modules/aws-crt/dist/native/binding.js 54:18-31
Critical dependency: the request of a dependency is an expression
    at CommonJsRequireContextDependency.getWarnings (/home/kayo/workspace/<snip>/node_modules/webpack/lib/dependencies/ContextDependency.js:91:18)
    at Compilation.reportDependencyErrorsAndWarnings (/home/kayo/workspace/<snip>/node_modules/webpack/lib/Compilation.js:3132:24)
    at /home/kayo/workspace/<snip>/node_modules/webpack/lib/Compilation.js:2729:28
    at _next2 (eval at create (/home/kayo/workspace/<snip>/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at eval (eval at create (/home/kayo/workspace/<snip>/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:42:1)
    at /home/kayo/workspace/<snip>/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:385:11
    at /home/kayo/workspace/<snip>/node_modules/neo-async/async.js:2830:7
    at Object.each (/home/kayo/workspace/<snip>/node_modules/neo-async/async.js:2850:39)
    at /home/kayo/workspace/<snip>/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:361:18
    at /home/kayo/workspace/<snip>/node_modules/neo-async/async.js:2830:7
 @ ./node_modules/aws-crt/dist/native/crt.js 25:34-54
 @ ./node_modules/aws-crt/dist/index.js 38:25-48
 @ ./node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js 3:96-114
 @ ./node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js 5:0-52 16:23-37
 @ ./node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js 16:0-65 26:898-914
 @ ./node_modules/@aws-sdk/client-s3/dist-es/S3Client.js 14:0-73 19:24-42
 @ ./node_modules/@aws-sdk/client-s3/dist-es/index.js 2:0-27 2:0-27
 @ ./src/FileManager.ts 37:0-64 116:34-50 148:28-36
 @ ./src/index.ts 49:0-40 76:34-45

...

2 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.72.1 compiled with 2 warnings in 4115 ms

# kayo @ <snip> in ~/<snip> [1:16:04] 
$ npm explain aws-crt
[email protected]
node_modules/aws-crt
  aws-crt@"^1.12.2" from the root project
  aws-crt@"^1.12.2" from @aws-sdk/[email protected]
  node_modules/@aws-sdk/signature-v4-crt
    @aws-sdk/signature-v4-crt@"^3.88.0" from the root project
    peerOptional @aws-sdk/signature-v4-crt@"^3.79.0" from @aws-sdk/[email protected]
    node_modules/@aws-sdk/signature-v4-multi-region
      @aws-sdk/signature-v4-multi-region@"3.88.0" from @aws-sdk/[email protected]
      node_modules/@aws-sdk/client-s3
        @aws-sdk/client-s3@"^3.92.0" from the root project

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants