aws / aws-iot-device-sdk-js

SDK for connecting to AWS IoT from a device using JavaScript/Node.js
Apache License 2.0
965 stars 385 forks source link

Could not find a declaration file for module 'aws-iot-device-sdk' #417

Closed mvadrev closed 1 year ago

mvadrev commented 1 year ago

Describe the issue

Trying to setup using this example on angular13: Check links

After i npm install and try to import : import * as AWSIoTData from "aws-iot-device-sdk";

it complains that:

'AWSIoTData' is declared but its value is never read.ts(6133)
Could not find a declaration file for module 'aws-iot-device-sdk'. 'c:/Users/mvadr/OneDrive/Desktop/aws-mqtt/node_modules/aws-iot-device-sdk/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/aws-iot-device-sdk` if it exists or add a new declaration (.d.ts) file containing `declare module 'aws-iot-device-sdk';`ts(7016)

npm i --save-dev @types/aws-iot-device-sdk does not seem to be working

Any updated tutorial as i see there seem to be some issues with angular 12+?

Links

https://github.com/eelayoubi/aws-examples/blob/master/aws-examples/src/app/app.component.ts

https://dev.to/eelayoubi/decoupling-an-app-using-aws-iot-577a

jmklix commented 1 year ago

Can you try both of these options:

When a module is not yours - try to install types from @types:

npm install -D @types/module-name If the above install errors - try changing import statements to require:

// import * as yourModuleName from 'module-name'; const yourModuleName = require('module-name');

github-actions[bot] commented 1 year ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.