summernote: IndexSizeError in Chrome : Still Occuring

steps to reproduce

Using empty editor instance on summernote.org which currently has v0.8.1 of summernote.js

If I do the following: <kbd>a</kbd> -> <kbd>SPACE</kbd> - > <kbd>CTRL</kbd> + <kbd>b</kbd> -> <kbd>SPACE</kbd> (code view shows <p>a <b>&nbsp;</b></p> in Chrome at this point)

I get this error:

Uncaught IndexSizeError: Failed to execute 'setStart' on 'Range': 
The offset 2 is larger than or equal to the node's length (1).

There is a similar error in Microsoft Edge; Firefox is unaffected. I do see that the generated HTML is slightly different in each case.

If I do the following: <kbd>CTRL</kbd> + <kbd>b</kbd> -> <kbd>a</kbd> -> <kbd>a</kbd> -> <kbd>CTRL</kbd> + <kbd>b</kbd> -> <kbd>SPACE</kbd> (code view shows <p><b>aa</b>&nbsp;</p> in Chrome at this point)

I get this error:

Uncaught IndexSizeError: Failed to execute 'setEnd' on 'Range': 
The offset 2 is larger than or equal to the node's length (1).

I see this error only in Chrome.

browser version and os version

Windows 10 Chrome 48

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 13
  • Comments: 21 (7 by maintainers)

Most upvoted comments

Steps to reproduce.

  • Press tab 5-6 times in empty doc
  • Press ctrl+z
screen shot 2017-03-24 at 4 37 41 pm

Reproducing @balramkhichar 's instructions from above on the official https://summernote.org/ instance shows the issue isn’t yet fixed (and the removeModule trick from above doesn’t seem to have any impact either).

I did find that the error is in the autoLink module. Luckily I don’t need it. If you don’t need it either, you can do this after initialization –

$('.summernote').summernote('removeModule', 'autoLink');

I wanted to say that I have switched to trix editor because of such errors in Summernote

Hi, I also have this issue. Uncaught DOMException: Failed to execute 'setStart' on 'Range': The offset 2 is larger than or equal to the node's length (1). Did anyone found the resolution? Thanks

I have the same issue, any suggestion