antonmedv/codejar

Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index.

tbuckel opened this issue · 1 comments

Hi,
I'm getting the following exception in Chrome as soon as I'm typing a character:

Uncaught DOMException: Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index.
    at afterCursor (https://medv.io/codejar/codejar.js:180:22)
    at handleSelfClosingCharacters (https://medv.io/codejar/codejar.js:234:27)
    at HTMLDivElement.<anonymous> (https://medv.io/codejar/codejar.js:55:13)

My setup is rather unique (e.g. dynamical import of the module), so expect it's a problem with my setup. I tried both highlight.js and Prism, both same result. Any pointers to where the problem lies would be much appreciated.

Thanks,
Thomas

Worked it out. Apparently the framework I'm using uses iFrames and I needed to pass in a "different" window.