console-highlight icon indicating copy to clipboard operation
console-highlight copied to clipboard

Cannot set property length of [object Object] which has only a getter

Open ghost opened this issue 8 years ago • 2 comments

I performed these steps:

git clone https://github.com/dtao/console-highlight.git cd console-highlight npm install node test.js

And this is my output:

/path/to/console-highlight/node_modules/jsdom/lib/jsdom/level1/core.js:553
      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 (/path/to/console-highlight/node_modules/jsdom/lib/jsdom/level1/core.js:553:30)
    at null.<anonymous> (/path/to/console-highlight/node_modules/jsdom/lib/jsdom/level2/events.js:332:20)
    at proto.(anonymous function) [as insertBefore] (/path/to/console-highlight/node_modules/jsdom/lib/jsdom/utils.js:23:26)
    at core.Node.appendChild (/path/to/console-highlight/node_modules/jsdom/lib/jsdom/level1/core.js:671:17)
    at null.textContent (/path/to/console-highlight/node_modules/jsdom/lib/jsdom/level3/core.js:187:10)
    at /path/to/console-highlight/node_modules/htmlout/htmlout.js:94:27
    at Array.forEach (native)
    at htmlout (/path/to/console-highlight/node_modules/htmlout/htmlout.js:92:15)
    at htmlout (/path/to/console-highlight/node_modules/htmlout/htmlout.js:116:12)
    at consoleHighlight (/path/to/console-highlight/consoleHighlight.js:20:10)

What's going wrong?

ghost avatar Mar 23 '16 12:03 ghost

Seeing the same thing on node 4.4.4

mhkeller avatar Jun 02 '16 18:06 mhkeller

Still the same on node 6, but... as this is a very simple library (highlight.js + htmlout) I tried to do it myself and the problem persists... it's an htmlout fault.

dresende avatar Mar 27 '17 14:03 dresende