Closed ldstein closed 11 years ago
I'm currently following the instructions to browserify mows:
npm install -g browserify // install browserify cd node_modules/mows npm install . // install dev dependencies browserify index.js -s mows > mows.js // require mows.js in your client-side app
The generated 'mows.js' file throws the following error once loaded in the browser:
Uncaught Error: Cannot find module './../../node_modules/mows/browser'
It's possible the browserify input file should be 'browser.js', not 'index.js'.
browserify browser.js -s mows > mows.js // require mows.js in your client-side app
I'm able to use mows successfully browser side using this change.
Simple browser-side app which works with this change:
var client = mows.createClient(3001, 'localhost'); client.subscribe('presence'); client.publish('presence', 'Hello mqtt'); client.on('message', function (topic, message) { console.log(message); });
Many thanks!
I'm currently following the instructions to browserify mows:
The generated 'mows.js' file throws the following error once loaded in the browser:
It's possible the browserify input file should be 'browser.js', not 'index.js'.
I'm able to use mows successfully browser side using this change.
Simple browser-side app which works with this change: