TypeError: _qz.websocket.connection.sendData is not a function

1,138 views
Skip to first unread message

Wai-Sun Chia

unread,
Sep 7, 2018, 2:44:36 AM9/7/18
to qz-print
Guys,
I'm getting this error after a period of not working on this print module for 1-2 months. Previously it was working fine...
The demo works though!!!

So I'm at a lost of what to look out for..
Throw me a bone guys..

Tres Finocchiaro

unread,
Sep 7, 2018, 9:58:28 AM9/7/18
to Wai-Sun Chia, qz-print
This generally means that there is a race condition.  For example, you may be calling qz.printers.find(...) before qz.websocket.connect() has finished.

To fix this, you need to use a proper promise chain.


--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Praveen Sharma (Elegance Services Pvt Ltd)

unread,
Jul 9, 2025, 6:07:24 AMJul 9
to qz-print
t.websocket.connection.sendData is not a function 

Lite Finocchiaro

unread,
Jul 9, 2025, 8:51:01 AMJul 9
to Praveen Sharma (Elegance Services Pvt Ltd), qz-print
Praveen:

This email thread is seven years old. If you have a question, please start a new thread.

Kind regards,

Lite Finocchiaro
VP, QZ Industries

Tres Finocchiaro

unread,
Jul 9, 2025, 12:15:00 PMJul 9
to Praveen Sharma (Elegance Services Pvt Ltd), qz-print
t.websocket.connection.sendData is not a function 

This can happen as a result of a race condition or a websocket disconnection.

Here's a code snippet that will check for an active connection before printing:
Reply all
Reply to author
Forward
0 new messages