Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline SVG with use tag that reference external file doesn't work and potentially crashes #43

Closed
strindhaug opened this issue Aug 28, 2023 · 0 comments

Comments

@strindhaug
Copy link
Contributor

Steps To Reproduce

When trying to generate an image from html containing an SVG with a use tag that references an external file, it doesn't work. And if the url contains a query-string for cache busting or other characters that is invalid in a querySelector it will cause a javascript crash.

Example:
Playground for https://codesandbox.io

Error Message & Stack Trace

Uncaught (in promise) DOMException: Document.querySelector: 'svg external-symbol.svg?cacheBust=123#icon' is not a valid selector
    At https://unpkg.com/modern-screenshot:7
    S https://unpkg.com/modern-screenshot:1
    S https://unpkg.com/modern-screenshot:1
    At https://unpkg.com/modern-screenshot:7

...etc

Your Environment

  • modern-screenshot: [e.g. 4.4.9]
  • Browser: [e.g. chrome 111.0.5563.64]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants