Problem regarding sockJS with Client Library


I've tried to use the JavaScript Client Library to connect to push updates, but I can't seem to initialize the SockJS Object.

Here's the error message:

Uncaught TypeError: SockJS is not a constructor
    at OctoPrintSocketClient.connect (

my relevant code:

<script src="./node_modules/jquery/dist/jquery.min.js"></script>
<script src=""></script>
<script src=""></script>


OctoPrint.options.baseurl = ""
OctoPrint.options.apikey = "11D742B6682D46709154B045CC222B0D";

  .done(function (response)
    // do something with the response

The file list works without problem.
Tried to use reconnect instead of connect, but same issue.
Does someone know what could be my error?

Used OctoPrint Version: 1.3.10.post5+g8ce2290d

If you want to use the socket you also need to include the sockjs library in your scripts.

1 Like

oh I somehow thought that was included with the packed client file. Thanks! :smiley: