kembedded
kembedded

Reputation: 515

at WebSocket.socket.onerror in LiveQueryClient.js when start app

I have a problem with my small demo for live query as in attached image.

To be honest, I have no idea why does it go wrong. Try to find some solutions around but not yet successfully. Please give me some ideas or solutions if you know this issue. Thanks so much.

Parse server example: 1.4.0

Parse JS SDK: 1.10.2

NodeJS: 8.9.1

npm: 5.5.1

P/S: I have added classes for supporting by Live Query already.

enter image description here

Here is the source which run successfully without using Live Query

enter image description here

Link to src with removed parse link:

var Parse = require('parse/node');

Parse.initialize("shetei5aeJ9Aequi6deejojiv7foh6Hieg2eesh9keingohw");
Parse.serverURL = 'serURLhere';

var Node = Parse.Object.extend('Node');
var q = new Parse.Query('Node');
var subscription = q.subscribe();

var procEventOpen = () => {
    console.log('subscription opened...');
};

subscription.on('open', procEventOpen);

Upvotes: 1

Views: 315

Answers (1)

rooswelt
rooswelt

Reputation: 61

This happened to me when I had a typo in server url. Try to explicit specify liveQueryServerURL parameter:

Parse.liveQueryServerURL = 'ws://yourserverurl/parse';

Note the ws instead of http(s)

Upvotes: 1

Related Questions