The project works just fine on my computer. These are the steps I ran:
- Clone the code:
git clone https://github.com/Rusydy/print-qz-static
- Extract the certificate file used for signing messages by removing the quotes and newlines from the x509 certificate in
qz-cert.js
and saving it as certificate.crt
.
- Install and open QZ Tray
- Open the Site Manager dialog in QZ Tray (QZ Tray icon, Advanced, Site Manager)
- Drag-and-drop the
certificate.crt
file into the Site Manager dialog.
- Open
index.html
, click "Test printer"
I did receive a JavaScript error, however it did not result in a pop-up warning dialog. The document prints first time, no pop-ups.

qz-cert.js:27 Uncaught TypeError: Cannot read properties of undefined (reading 'then')
at qz-cert.js:27:3
This error message is fairly benign, but it's because you're using a .then(...)
on your setCertificatePromise()
call here. The function call setCertificatePromise()
does not return a promise, so any error detection must be internal (e.g. manually throw an exception raised by fetch()
or $.ajax()
, etc when loading this certificate from a URL). Since you're loading the certificate from a string value, no exception handling is needed, but regardless, .then()
must be removed from this file to remove the error.
In regards to the pop-up you are receiving, this is a sign that the certificate you've created hasn't been installed into QZ Tray. You may drag-and drop it into the Site Manager dialog to install it to your system (or manually by copying it to <appdir>\override.crt
and restarting QZ Tray).