Open kharandziuk opened 9 years ago
Ok, sorry. Now I understand the issue the library isn't browserify compatible at all
The issue isn't that the library is not browserify compatible (indeed it is compatible). The issue is that the BCSocket isn't isomorphic/universal (i.e. there are two different implementations of BCSocket: one of the server and one for clients).
on the server use:
var BCSocket = require('browserchannel').BCSocket;
and on the client use:
var BCSocket = require('browserchannel/dist/bcsocket-uncompressed').BCSocket;
var socket = new BCSocket( null, {reconnect: true} );
Hope this helps.
my main.js just import the library:
var BCSocket = require('browserchannel').BCSocket;
I compile file with gulpfile below
When I open file in browser I achieve an error
Uncaught TypeError: fs.statSync is not a function
.What may cause the problem?