When I input or paste some javascript codes below, It print “RangeError: Token end out of bounds” in the console. This error is related to @lezer/lr/dist/index.js → acceptToken(token, endOffset = 0).
when I remove the js or the - at the beginning , this error disappear. When I remove the markdown highlight extension, it also disappear.
The same character with the two example is $ in code box and - at the beginning, and such code is really common in javascript. I hope that this bug will be fixed, thanks~
Thanks for your reply. After checking the package’s version with command npm ls -a, all of the @lezer/common version is 1.0.2.
I try hard to simplify the code in my React Project, and put it into the “Try CodeMirror” page, but I also can not reproduce this error. And the error in my project never disappear.
I think the only difference between them is the React ? So, I use a codeSandBox to reproduce it :
when you paste the code below, it throw this error.
I think this error doesn’t exist in the previous CodeMirror 6 version. Because I continuously developed the same React note-taking software based on CodeMirror 6 among the last year. It appear suddenly when I upgraded to a new version and opened an old note file with such code which pasted at last year.
I try to degrade the version. When I degrade the @codemirror/language from 6.6.0 to 6.5.0 and the @codemirror/language-data from 6.2.0 to 6.1.0, this problem disappear. I hope this information will help the debug, which means that the problem is not about the @lezer~