aws-iot-device-sdk-js: Uncaught TypeError: filesys.existsSync is not a function

Using the aws-iot-sdk-browser-bundle.js (browsery of node.js aws-iot-device-sdk module);

var awsIot = require('aws-iot-device-sdk');

var device = awsIot.device({
    endpoint: 'https://******************.iot.eu-central-1.amazonaws.com',
    keyPath: '../aws/************-private.pem.key',
    certPath: '../aws/***********-certificate.pem.crt',
            caPath: '../aws/***********-public.pem.key',
    clientId: "******************",
            region: "******" 
});

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19

Most upvoted comments

i am also getting same problem how can i solve this issue pls tell me

Anybody has solved this question ?

Indeed… I currently got my prototype working… with WSS. So I am pubbing as a device, as a thingshadow and reading the last state via REST… this will do for my current PoC

Thx for responding.

Next step will be to write a more advance app using Angular + Ionic. : will see when I have the time to dive in to this… at least this has a lower priority since I have a bunch of other tasks to do.

Regards,

Daniel

Daniel Vangrieken

Email : daniel.vangrieken@gmail.com Phone: +32 (0) 476 / 99 65 61

2016-07-23 2:23 GMT+02:00 rongsaws notifications@github.com:

Since you are doing a prototype, instead of using Cognito, you could use IAM key and credential to initialize your Websocket connection. Browserifying TSL connection is currently not supported unfortunately, so you want to stick with the Websocket solution for browser applications for now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aws/aws-iot-device-sdk-js/issues/76#issuecomment-234686712, or mute the thread https://github.com/notifications/unsubscribe-auth/AS4X3uWGReaB1QSRWKS95uHLOYO9LcWhks5qYV8XgaJpZM4JQ78y .

Since you are doing a prototype, instead of using Cognito, you could use IAM key and credential to initialize your Websocket connection. Browserifying TSL connection is currently not supported unfortunately, so you may want to stick with the Websocket solution for browser applications for now.

I first had to read the documentation: apperently AWS only support mqtt over wss. I thought that with the modern browser raw tcp protocol was also implemented in the sdk so mqtt over tcp could be supported. So the buffering is not required anymore and the above remark about hitting this code can also be ignored.

This topic issue can be closed… unless you guys want to provide support in browsers for mqtts via tcp 😉