codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.93k stars 376 forks source link

Uncaught RangeError: Maximum call stack size exceeded #271

Closed davidye closed 4 years ago

davidye commented 4 years ago

When inputing a large json value with javascript mode, I'm getting this error:

Uncaught RangeError: Maximum call stack size exceeded
    at StackBufferCursor.fork (codemirror.js:17779)
    at findBufferSize (codemirror.js:1618)
    ...

To repo, go to https://codemirror.net/6/ and paste in the contents of this attached json file. The syntax highlighting is broken. Then immediately try editing a few things and this error will (sometimes?) come up. I sometimes also see additional error messages:

TypeError: Cannot read property 'split' of undefined
    at ParseContext.forceFinish (codemirror.js:18357)
    ...
Uncaught Error: Calls to EditorView.update are not allowed while an update is in progress
    at EditorView.update (codemirror.js:9814)
    ...

test.txt

I'm on Chrome 84 on OSX. I also tried this on CodeMirror 5 and it worked fine.

marijnh commented 4 years ago

Should be fixed by https://github.com/lezer-parser/lezer/commit/2dc1c6b31f5d28e92c4df5d33718969996cb59a3 . Upgrade to lezer 0.10.1 to get the fix.