Closed lautiamkok closed 6 years ago
I have the same issue here even when trying the Getting started example.
@pedronasser I have got it sorted. Have you?
The reason for this error is because Nuxt is a server side app, while socketcluster-client is to be installed on the client side.
FYI, you can use the client, server-side too. Eg:
const scClient = require('socketcluster-client');
const socket = scClient.connect({hostname: "you.host.name", port: 8008});
although if you do use the client, server-side, i recommend to wrap everything in an on connect event eg:
socket.on('connect', function () {
console.log('CONNECTED');
let IssuesChannel = socket.subscribe('Github/Issues');
IssuesChannel .watch((data) => {
console.log(data);
});
});
It does not seem to work when I try to use socketcluster-client & socketcluster-server with Koajs and Nuxtjs. I get this error:
What does it mean?