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.

does't work in IE11 with ES6. Unable to get property 'svg' of undefined or null reference

See original GitHub issue

it doesn’t work in IE11 with ES6.

import html2canvas from "html2canvas"; return html2canvas(node, { allowTaint: true }).then((canvas) => { return Promise.resolve(canvas.toDataURL()); });

Unhandled rejection TypeError: Unable to get property ‘svg’ of undefined or null reference at SVGContainer.prototype.hasFabric at SVGNodeContainer at ImageLoader.prototype.loadImage at Anonymous function at Anonymous function at ImageLoader.prototype.findImages at ImageLoader.prototype.fetch at NodeParser at renderWindow at Anonymous function

function Support(document) { this.rangeBounds = this.testRangeBounds(document); this.cors = this.testCORS(); this.svg = this.testSVG(); }

I found it was broken by the property of ‘svg’, this value is judge whether canvas can draw the image of SVG. In IE11, it always return false.

` function SVGNodeContainer(node, _native) { this.src = node; this.image = null; var self = this;

this.promise = _native ? new Promise(function(resolve, reject) {
    self.image = new Image();
    self.image.onload = resolve;
    self.image.onerror = reject;
    self.image.src = "data:image/svg+xml," + (new XMLSerializer()).serializeToString(node);
    if (self.image.complete === true) {
        resolve(self.image);
    }
}) : this.hasFabric().then(function() {
    return new Promise(function(resolve) {
        window.html2canvas.svg.fabric.parseSVGDocument(node, self.createCanvas.call(self, resolve));
    });
});

} `

**as the ‘_native’ from ‘this.svg’ is false, then go through the this.hasFabric and window.html2canvas.svg which are ‘undefined’, I don’t know why.

when I change this.svg = true, it can work. Thus, could you help resolve it or set the ‘svg’ to higher level so that I can change this value and its behavior?**

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
kgcroteaucommented, Sep 27, 2017
0reactions
DanLatimercommented, Sep 27, 2017

@kgcroteau could you include the doc or the information here too? I’m having the same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 4 ERROR TypeError: Unable to get property 'apply' of ...
I get the following error only in IE 11, I did a lot of searching, ... Unable to get property 'apply' of undefined...
Read more >
Getting error in google recaptcha IN IE.
We're seeing the exact same thing on our website on IE11 here too. "Unable to get property 'toString' of undefined or null reference....
Read more >
does't work in IE11 with ES6. Unable to get property 'svg' of ...
it doesn't work in IE11 with ES6. import html2canvas from "html2canvas"; return html2canvas(node, { allowTaint: true }).then((canvas) => {
Read more >
Unable to get property status of undefined or null reference ...
The issue arise when js/jquery is not able to refer to the element. It is because at the time of rendering the page(view),...
Read more >
swimlane/ngx-charts - Gitter
Angular 2 works fine in IE11 but I can't get the charts to work - i added an ... caused by: Unable to...
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