Skip to content

Bundle & Minify with WebPack? #146

Open
@Kilowhisky

Description

Confirm by changing [ ] to [x] below:

Known Issue

  • I'm using ATS data type endpoint: the endpoint should look like <prefix>-ats.iot.<region>.amazonaws.com

Platform/OS/Hardware/Device
nodejs on windows / linux (attempting to deploy)

Describe the question

I'm attempting to package up my device communicator that uses aws-iot in a node app into a command line tool that can be deployed into a device linux environment and i'm having problems with WebPack. Is there anything special i have to do to get it to work?

My code completely works without running it through WebPack and WebPack builds and runs just fine if i exclude any of the AWS stuff so i think it has to do with the import of the AWS stuff.

> webpack --config webpack.config.js

asset app.min.js 149 KiB [emitted] [minimized] (name: main)
runtime modules 211 bytes 2 modules
cacheable modules 412 KiB
  modules by path ./node_modules/ 398 KiB 36 modules
  modules by path ./app/*.ts 14.4 KiB
    ./app/app.ts 3.61 KiB [built] [code generated]
    ./app/server.ts 6.24 KiB [built] [code generated]
    ./app/aws-connection.ts 4.56 KiB [built] [code generated]
11 modules

WARNING in ./node_modules/aws-crt/dist/native/binding.js 55:18-31
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/aws-crt/dist/native/io.js 11:34-54
 @ ./node_modules/aws-crt/dist/index.js 39:24-46
 @ ./node_modules/aws-iot-device-sdk-v2/dist/index.js 38:18-36
 @ ./app/server.ts 11:32-64
 @ ./app/app.ts 6:17-36

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

webpack 5.30.0 compiled with 1 warnings in 2679 ms
> node .\dist\app.min.js
<huge dump of my app.min.js file itself>

Error: AWS CRT binary not present in any of the following locations:
        C:\path\bin\native\aws-crt-nodejs
        C:\path\bin\win32-x64\aws-crt-nodejs
    at Object.1221 (C:\path\dist\app.min.js:1:11199)
    at n (C:\path\dist\app.min.js:1:152697)
    at Object.7227 (C:\path\dist\app.min.js:1:11527)
    at n (C:\path\dist\app.min.js:1:152697)
    at Object.8687 (C:\path\dist\app.min.js:1:4043)
    at n (C:\path\dist\app.min.js:1:152697)
    at Object.7290 (C:\path\dist\app.min.js:1:29541)
    at n (C:\path\dist\app.min.js:1:152697)
    at Object.8316 (C:\path\dist\app.min.js:1:32467)
    at n (C:\path\dist\app.min.js:1:152697)

Is there anything i need to do so that it will be able to pass through WebPack?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    documentationThis is a problem with documentation.feature-requestA feature should be added or improved.p2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions