styles issue in 1.11.13

Author: 80avinCreated Mar 30, 2025Updated Feb 4, 2026
Labelsbug

On upgrading html-to-image from 1.11.11 to 1.11.13 in https://github.com/80avin/jsontree/tree/cde2580307f9e6e891bc8326c5f5d3bf24edfdca I see the SVG & png are not drawn correctly. On inspecting, I find that the line modified in PR https://github.com/bubkoo/html-to-image/pull/384 is giving error

Error loading remote stylesheet SyntaxError: Failed to execute 'insertRule' on 'CSSStyleSheet': Failed to parse the rule

Strangely, the exact same rule passes in 1.11.13 and the only difference I see in the failing line was introduced in https://github.com/bubkoo/html-to-image/pull/384

Expected Behavior

Download image like

Image

Current Behavior

Image generated is

Image

Possible Solution

Steps To Reproduce

  1. Clone the project https://github.com/80avin/jsontree/tree/cde2580307f9e6e891bc8326c5f5d3bf24edfdca ( checkout to this commit if it is not latest )
  2. Update html-to-image to 1.11.13
  3. Run the app and click on download button in header
Error Message & Stack Trace

txt
<!-- Provide a log message if relevant -->

Additional Context

Your Environment

  • html-to-image: 1.11.13
  • OS: Ubuntu 24.04
  • Browser: Version 134.0.6998.165 (Official Build) (64-bit)