Parser/runtime version mismatch #11

Closed
opened 2022-07-31 01:22:29 +02:00 by Me1000 · 2 comments
Me1000 commented 2022-07-31 01:22:29 +02:00 (Migrated from github.com)

I'm getting the following error when I try to run the output of this template as a play language using the latest CodeMirror:

Uncaught RangeError: Parser version (14) doesn't match runtime version (13)

I've tried it with the latest version of codemirror 6's individual packages:

"@codemirror/autocomplete": "^6.1.0",
"@codemirror/commands": "^6.0.1",
"@codemirror/lang-javascript": "^6.0.2",
"@codemirror/language": "^6.2.1",
"@codemirror/lint": "^6.0.0",
"@codemirror/search": "^6.0.1",
"@codemirror/state": "^6.1.0",
"@codemirror/view": "^6.1.2"

and with just codemirror@6.0.1.

Looks like some dependency in CodeMirror wasn't updated when this commit dropped but I didn't look into it enough to figure out exactly what needed to be updated.

I'm getting the following error when I try to run the output of this template as a play language using the latest CodeMirror: ``` Uncaught RangeError: Parser version (14) doesn't match runtime version (13) ``` I've tried it with the latest version of codemirror 6's individual packages: ``` "@codemirror/autocomplete": "^6.1.0", "@codemirror/commands": "^6.0.1", "@codemirror/lang-javascript": "^6.0.2", "@codemirror/language": "^6.2.1", "@codemirror/lint": "^6.0.0", "@codemirror/search": "^6.0.1", "@codemirror/state": "^6.1.0", "@codemirror/view": "^6.1.2" ``` and with just `codemirror@6.0.1`. Looks like some dependency in CodeMirror wasn't updated when [this commit](https://github.com/lezer-parser/lr/commit/d3be7fb06778e6f7e6d044af5eacc2e5770e1c36) dropped but I didn't look into it enough to figure out exactly what needed to be updated.
marijnh commented 2022-08-01 15:43:55 +02:00 (Migrated from github.com)

Did you try removing your package lock and reinstalling from scratch? Are you referencing any @lezer packages in your dependencies? If so, make sure those reference 1.x versions.

Did you try removing your package lock and reinstalling from scratch? Are you referencing any `@lezer` packages in your dependencies? If so, make sure those reference 1.x versions.
Me1000 commented 2022-08-01 19:57:33 +02:00 (Migrated from github.com)

Ah, I see what's happening. Parcel has a sub-dependency on an older version of @lezer/lr and npm put that at the top level of my node_modules, so when I copied the built files to my project the imports were pulling in Parcel's version.

By adding the explicit dependency to @lzer/lr and @lzer/highlight to my project's package.json the import resolved correctly. This issue became rather obvious when I removed parcel and tried to build with rollup instead. I should have just read the built source file, that would have also probably made it obvious.

Ah, I see what's happening. Parcel has a sub-dependency on an older version of `@lezer/lr` and npm put that at the top level of my node_modules, so when I copied the built files to my project the imports were pulling in Parcel's version. By adding the explicit dependency to `@lzer/lr` and `@lzer/highlight` to my project's package.json the import resolved correctly. This issue became rather obvious when I removed parcel and tried to build with rollup instead. I should have just read the built source file, that would have also probably made it obvious.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/lang-example#11
No description provided.