hi unable use require('aws-iot-device-sdk') using browserify in nodejs application, error follows -
uncaught syntaxerror: unexpected identifier
from bundle.js
we able package aws-iot-device-sdk using browserify doing following:
- npm install -g browserify (only required once install browserify)
- mkdir project
- cd project
- create main.js:
var awsiot = require('aws-iot-device-sdk'); console.log('success');
- npm install aws-iot-device-sdk
- browserify main.js -o bundle.js
one thing did notice 1 of files our package depends on has characters in not recognized browser; able fix adding <meta charset="utf-8">
in our html prior referencing bundle.
Comments
Post a Comment