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

Next generation AWS IoT Client SDK for Node.js using the AWS Common Runtime
Apache License 2.0
223 stars 100 forks source link

Cant find module aws-crt-nodejs when running in browser env #92

Closed stefan-karlsson closed 4 years ago

stefan-karlsson commented 4 years ago

Known Issue

Describe the bug Failing to find module when running Jest tests.

Also this lib can't be run in a browser

SDK version number

"aws-crt": "^1.3.0",
"aws-iot-device-sdk-v2": "^1.3.1",

Platform/OS/Hardware/Device Windows 10

Expected behavior The build should be successful and able to run in a browser environment.

Logs/output

 Cannot find module 'C:\Development\xx\Projects\xx\node_modules\aws-crt\dist\bin\win32-x64\aws-crt-nodejs' from '../../node_modules/aws-crt/dist/native/binding.js'

    Require stack:
      C:/Development/xx/Projects/xx/node_modules/aws-crt/dist/native/binding.js
      C:/Development/xx/Projects/xx/node_modules/aws-crt/dist/native/crt.js
      C:/Development/xx/Projects/xx/node_modules/aws-crt/dist/index.js
      C:/Development/xx/Projects/xx/node_modules/aws-iot-device-sdk-v2/dist/greengrass/discoveryclient.js
      C:/Development/xx/Projects/xx/node_modules/aws-iot-device-sdk-v2/dist/index.js
      src/lib/clients/aws-ws-client.ts
      src/lib/clients/aws-ws-client.spec.ts

      at Resolver.resolveModule (../../node_modules/jest-resolve/build/index.js:307:11)
      at Object.<anonymous> (../../node_modules/aws-crt/lib/native/binding.js:40:19)
bretambrose commented 4 years ago

Can you supply the command line and an empty project skeleton via zip which show both of the issues?

github-actions[bot] commented 4 years ago

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.