#12152 closed Bug (expired)
Failed to execute 'setStart' on 'Range': The offset 2 is larger than or equal to the node's length (1).
Reported by: | Rob | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Selection | Version: | |
Keywords: | Cc: |
Description
Users get this regularly in all browsers, though they've yet to provide me good repro steps. Current example is in Chrome 35. Error bubbles up to window.onerror.
erroring line: https://github.com/ckeditor/ckeditor-dev/blob/master/core/selection.js#L1958
version: 4.4.2 (seen it as early as 4.2)
build configuration: http://ckeditor.com/builder/224773061e31c4aa24a72388cd90ca5b
Attachments (1)
Change History (9)
comment:1 Changed 10 years ago by
Status: | new → pending |
---|---|
Version: | 4.4.2 |
comment:2 Changed 10 years ago by
The package/configuration having the issue have been attached as scyat_error.zip file to the ticket. Following are the steps to reproduce the issue.
- enable scyat in configuration
- In the inline version of the ckeditor (/samples/inlineall.html), try inserting table.
The error is difficult to reproduce when scyat is not enabled programmatically.
The error comes up in IE 10 and IE 11 are as follows.
SCRIPT5022: IndexSizeError File: ckeditor.js, Line: 405, Column: 528 SCRIPT5007: Unable to get property 'checkReadOnly' of undefined or null reference File: ckeditor.js, Line: 331, Column: 190
In chrome it gives following error
Uncaught IndexSizeError: Failed to execute 'setStart' on 'Range': The offset 111 is larger than or equal to the node's length (23). ckeditor.js:405 CKEDITOR.dom.selection.selectRanges ckeditor.js:405 CKEDITOR.dom.selection.unlock ckeditor.js:399 CKEDITOR.editor.unlockSelection ckeditor.js:384 (anonymous function) ckeditor.js:376 h ckeditor.js:10 CKEDITOR.event.CKEDITOR.event.fire ckeditor.js:12 CKEDITOR.dom.domObject.a ckeditor.js:46 CKEDITOR.editable.CKEDITOR.tools.createClass.proto.focus ckeditor.js:327 (anonymous function) ckeditor.js:335 h ckeditor.js:10 CKEDITOR.event.CKEDITOR.event.fire ckeditor.js:12 CKEDITOR.editor.CKEDITOR.editor.fire ckeditor.js:13 CKEDITOR.tools.extend.focus ckeditor.js:245 g ckeditor.js:325 CKEDITOR.editable.CKEDITOR.tools.createClass.proto.insertElementIntoSelection ckeditor.js:332 CKEDITOR.editable.CKEDITOR.tools.createClass.proto.insertElement ckeditor.js:331 (anonymous function) ckeditor.js:335 h ckeditor.js:10 CKEDITOR.event.CKEDITOR.event.fire ckeditor.js:12 CKEDITOR.editor.CKEDITOR.editor.fire ckeditor.js:13 CKEDITOR.tools.extend.insertElement ckeditor.js:245 onOk table.js?t=E6FD:10 (anonymous function) ckeditor.js:526 h ckeditor.js:10 CKEDITOR.event.CKEDITOR.event.fire ckeditor.js:12 CKEDITOR.tools.extend.okButton.CKEDITOR.tools.extend.onClick ckeditor.js:548 (anonymous function) ckeditor.js:491 h ckeditor.js:10 CKEDITOR.event.CKEDITOR.event.fire ckeditor.js:12 CKEDITOR.ui.dialog.button.CKEDITOR.tools.extend.click ckeditor.js:490 (anonymous function) ckeditor.js:482 h ckeditor.js:10 CKEDITOR.event.CKEDITOR.event.fire ckeditor.js:12 CKEDITOR.dom.domObject.a ckeditor.js:46
comment:3 Changed 10 years ago by
Version: | → 4.4.5 |
---|
also getting this error. on version 4.4.5. this is the build configuration: http://ckeditor.com/builder/2c49f3a8c4d3e6fa7f7a7c90dfdcda10
Uncaught IndexSizeError: Failed to execute 'setStart' on 'Range': The offset 5 is larger than or equal to the node's length (4).
CKEDITOR.editable.CKEDITOR.tools.createClass.proto.focus editable.js:77(anonymous function) editable.js:523listenerFirer event.js:144CKEDITOR.event.fire event.js:290CKEDITOR.editor.fire editor_basic.js:24CKEDITOR.tools.extend.focus
this is happening for example when writing a bit of text, then using the BOLD style, writing a bit more text. then clicking outside of the editor and then clicking inside the editor twice (need to click fairly quickly more than once but doesnt need to be double-click).
the same reported error occurs. at line: 1963 of selection.js.
this is happening with the editor in optimized or with the source uncompressed.
after that, the cursor is always at the beginning of the text.
comment:4 Changed 10 years ago by
Version: | 4.4.5 |
---|
@rishabh91 I have tried your configuration and the only error I got was "Invalid argument" which gets thrown in scayt script and not in editor. In IE11 I have focused one of editors in inlineAll.html samples and inserted table. The key condition was that first word needs to get underlined by scayt.
This is scayt issue as has been reported to scayt team.
I didn't get any IndexSizeError. If you get this error, please provide screen cast for it and tell me if you are using default IE11 or you have got some plugins installed for it or you are using compatibility or quirks mode?
@lpyoav I haven't been able to reproduce this problem as well. Your issue looks a little bit like this one #10858. at least some comments match your description.
Just like above, could you provide screen case and additional explanations?
comment:5 Changed 10 years ago by
hi j.swiderski
Ive pinpointed the cause of the problem.
We have the following code:
contentsElement = $(ckeditor.ui.space("contents").$); contentsElement.off("click").on("click", function (e) { ckeditor.focus(); });
the contents container is bigger than the editable container so without our code, when the user clicks on the contents container which looks like its editable the focus isnt set on the editable area.
So our code improves the experience but causes the issue. a way to reproduce the issue with this code is:
- start typing
- use the bold button
- type a few more characters
- click outside of the editor - so it loses focus
- click once in the editable area
- quickly click on the contents area
the error is then thrown.
CK doesnt make sure its calling the nativeRange.setStart with valid arguments in selection.js (line 1963).
what I dont understand is why isnt CK doing the focus on the editable area when a user clicks on the contents area itself. it seems like a must-have.
comment:6 Changed 10 years ago by
@@lpyoav I have tried your configuration, plus code in one of samples of my choice but haven't managed to reproduce it.
Could I ask you to two things?
- Sample HTML page that can be pasted into editor samples folder and used to reproduce this error.
- Description was quite clear but I perhaps you could also provide screen cast for this issue.
comment:7 Changed 10 years ago by
Resolution: | → expired |
---|---|
Status: | pending → closed |
comment:8 Changed 10 years ago by
Any update about it, I still found the same error in our current version. http://stackoverflow.com/questions/29886961/ckeditor-error-uncaught-indexsizeerror-failed-to-execute-extend-on-selectio Thanks.
I'm sorry but this is to little information.
Once you know how to reproduce this issue: