Ngx-Editor + CodeMirror: "Invalid change range" error when typing after completely clearing...

Discussão em 'Angular' iniciado por Karthik S, Março 31, 2025.

  1. Karthik S

    Karthik S Guest

    I'm using ngx-editor with prosemirror-codemirror-6 in an Angular project to add a code_mirror node. The editor works fine, but when I press Typing continuously inside a code_mirror block, I get the following error:

    hook.js:608 ERROR RangeError: Invalid change range 6 to 6 (in doc of length 0)
    at process (index.js:962:57)
    at _ChangeSet.of (index.js:973:5)
    at _EditorState.changes (index.js:2596:22)
    at applyDefaultInsert (index.js:3961:30)
    at defaultInsert (index.js:3948:55)
    at applyDOMChangeInner (index.js:3949:118)
    at EditContextManager.handlers.textupdate (index.js:7173:9)
    at _ZoneDelegate.invokeTask (zone.js:402:33)
    at core.mjs:6193:49
    at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:6193:30)


    Followed this StackBliz

    Note:- Installed package details

    • Angular version is 19.1.0
    • @codemirror/lang-javascript version is 6.2.3
    • codemirror version is 6.0.1
    • prosemirror-codemirror-6 version is 1.0.1

    Continue reading...

Compartilhe esta Página