question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVG in <img> breaks export in IE11

See original GitHub issue

Exporting <img src='some_image.svg'> element with SVG content using IE11 ends with error:

TypeError: Unable to get property 'svg' of undefined or null reference at SVGContainer.prototype.hasFabric (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:3214:5) at SVGContainer (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:3204:5) at ImageLoader.prototype.loadImage (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:1291:13) at Anonymous function (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:1276:17) at Anonymous function (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:1274:9) at ImageLoader.prototype.findImages (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:1248:5) at ImageLoader.prototype.fetch (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:1354:5) at NodeParser (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:1841:5) at renderWindow (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:992:5) at Anonymous function (http://10.0.2.2:9000/lib/html2canvas/dist/html2canvas.js:979:13)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

2reactions
nearwoodcommented, Feb 6, 2017

Also see #834 window.html2canvas is undefined if a module loader is used, this sounds very familiar.

0reactions
petertflemcommented, Aug 31, 2017

Possible fix: https://github.com/niklasvh/html2canvas/issues/834 Need ran into another error, so don’t quite know if it works, but I no longer get the svg error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IE11 meta element Breaks SVG - internet explorer
It sounds as though you're not in a modern document mode. Internet Explorer 11 shows the SVG just fine when you're in Standards...
Read more >
IE11 SVG background images not displaying correctly
The Solution. In total there are four ways of exporting an SVG from Illustrator or other tools: Presentation Attributes. Style Attributes.
Read more >
Saving Browser-based SVGs as Images - Atomic Spin
SVG vector images drawn in the browser can be rasterized as PNG images using JavaScript, the canvas element, and a couple of data...
Read more >
Why text in exported SVG images may not display correctly
Why text in exported SVG images may not display correctly Print ... David is the author of this solution article. Did you find...
Read more >
Why text in exported SVG images may not ... - Diagrams.net
Simple explanation : The exported SVG is only designed to be displayed in web pages, we didn't design the output to be editable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found