Parser version (undefined) doesn't match runtime version (13)

when I want to use the codemirror autocomplete by import lang-tex - npm. shows error:

Unexpected Application Error!
Parser version (undefined) doesn't match runtime version (13)
RangeError: Parser version (undefined) doesn't match runtime version (13)
    at new _Parser (http://dev-tex.example.top/node_modules/.vite/deps/chunk-VML3AIQZ.js?v=f21e948c:11927:17)
    at _Parser.deserialize (http://dev-tex.example.top/node_modules/.vite/deps/chunk-VML3AIQZ.js?v=f21e948c:12198:16)
    at node_modules/.pnpm/lezer-tex@0.0.0-6_lezer@0.13.5/node_modules/lezer-tex/lib/index.js (http://dev-tex.example.top/node_modules/.vite/deps/chunk-VML3AIQZ.js?v=f21e948c:12402:37)
    at __require2 (http://dev-tex.example.top/node_modules/.vite/deps/chunk-AUZ3RYOM.js?v=f21e948c:18:50)
    at node_modules/.pnpm/lang-tex@0.0.3_lezer@0.13.5/node_modules/lang-tex/lib/tex.js (http://dev-tex.example.top/node_modules/.vite/deps/chunk-VML3AIQZ.js?v=f21e948c:12908:23)
    at __require2 (http://dev-tex.example.top/node_modules/.vite/deps/chunk-AUZ3RYOM.js?v=f21e948c:18:50)
    at node_modules/.pnpm/lang-tex@0.0.3_lezer@0.13.5/node_modules/lang-tex/lib/index.js (http://dev-tex.example.top/node_modules/.vite/deps/chunk-VML3AIQZ.js?v=f21e948c:17681:18)
    at __require2 (http://dev-tex.example.top/node_modules/.vite/deps/chunk-AUZ3RYOM.js?v=f21e948c:18:50)
    at http://dev-tex.example.top/node_modules/.vite/deps/lang-tex.js?v=b8d748a1:6:16

what should I do to fixed this issue?

It seems lang-tex is using an ancient, pre-1.0 version of Lezer, which isn’t compatible with the one used by current CodeMirror.

  "dependencies": {
    "lezer": "^0.13.4",

That package doesn’t look maintained. So you’d probably have to create a pull request or fork it to modernize it.

1 Like