Wednesday, 10 May 2017

Juice2 npm package throwing TypeError Cannot set property length of [object Object]

I'm trying to use Juice2 but am getting an TypeError that appears to be caused by Juice when using the basic example from the npm package page.

This the 'How to use' example given.

juice("/path/to/file.html", function(err, html) {
  console.log(html);
});

Here is my code.

function juicify() {
      console.log('juice called...');
      var path = './file.html'
      juice(path, function(err, html) {
          console.log(html);
      });
}

This is the longer version of the error output to the console.

Array.prototype.splice.call(this._childNodes, refChildIndex, 0, newChild);

    TypeError: Cannot set property length of [object Object] which has only a getter
        at core.Node.insertBefore

Anyone any ideas what the problem is? Thanks!



via mikeym

No comments:

Post a Comment