0๐
โ
I found the solution. I had to put setTimeout before calling print dialog:
setTimeout(() => {
winPrint.document.close();
winPrint.focus();
winPrint.print();
winPrint.close();
}, 500);
Now it works fine on production.
Source:stackexchange.com