google-chromeprintingcss-print

Printing in Chrome is loading preview forever


On my website, printing has stopped work with Google Chrome (version 81 on Linux, if that matters). The print preview window is stuck with showing "Loading preview...".

While doing this, Chrome prints the following message on the console:

[30378:30378:0424/004907.441044:ERROR:CONSOLE(2990)] "Uncaught TypeError: Cannot read property 'marginTop' of null", source: chrome://print/print_preview.js (2990)

When I open the developer tools and set the CSS media type emulation to "print", the page is shown correctly as it would be printed, and there are no errors in the console.

How can I find out where the problem comes from and how to fix it?


Solution

  • I could finally solve the problem by resetting Chrome. However, I still don't know the root cause of the problem.