add-to-homescreen
add-to-homescreen copied to clipboard
Uncaught TypeError: Cannot read property 'appendChild' of null (addtohomescreen.js:553)
There is an error on this line: // attach all elements to the DOM this.viewport.appendChild(this.element); this.container.appendChild(this.viewport); Does anybody know how to fix it?
I ran into that too. this.container
is supposed to refer to document.body
, but when it is being defined (on line 279) the document hasn't finished loading yet so document.body
is still null
.
I "fixed" it by adding
if (this.container == null) this.container = document.body;
to line 451 (where DOM and document are ready). Ugly, but it works.