You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser thermal receipt printing fails because printWindow.onload is assigned after document.close() on a synchronously constructed about:blank window, causing the onload handler and window.print() to never fire.
Root Cause
In frontend/src/lib/printer/PrinterService.ts, DOM nodes are inserted directly using replaceChildren(), followed by document.close(). The onload event handler is attached after document.close(). Because document.close() does not dispatch a load event when document.write() was not used, the onload event has already passed, so printWindow.print() is never called.
Why It Matters
When fallback browser printing is triggered, the receipt popup window remains open as a blank tab without bringing up the native print dialog.
Expected Behavior
printWindow.print() and printWindow.close() are called immediately after DOM manipulation and document.close() complete.
Actual Behavior
The onload callback never fires, leaving the popup open and failing to print the receipt.
Affected Files
frontend/src/lib/printer/PrinterService.ts
Suggested Implementation Direction
Call printWindow.print() and printWindow.close() directly after appending DOM nodes and calling document.close() instead of wrapping them in printWindow.onload.
Fixed in a0b41f1: printWindow.print()/close() now run directly after document.close() instead of being wrapped in onload, which never fired since the window's DOM was populated via replaceChildren/importNode rather than document.write().
Activity
fix: stop notification truncation, fix thermal print race, guard logi…
itsbkm commentedon Jul 29, 2026
Fixed in a0b41f1: printWindow.print()/close() now run directly after document.close() instead of being wrapped in onload, which never fired since the window's DOM was populated via replaceChildren/importNode rather than document.write().