error importing lang-javascript #29

Closed
opened 2024-01-16 16:23:17 +01:00 by lianee · 3 comments
lianee commented 2024-01-16 16:23:17 +01:00 (Migrated from github.com)

Hi,
I have a strange error since v1.4.12: just importing lang-javascript fails with this:

Uncaught TypeError: Cannot read properties of undefined (reading 'deserialize')
    at setProp (index.ac9dc4ba.js:27819:22)
    at new LRParser (index.ac9dc4ba.js:27830:51)
    at LRParser.deserialize (index.ac9dc4ba.js:28028:16)
    at dv8xE.@lezer/lr (index.ac9dc4ba.js:26252:34)
    at newRequire (index.ac9dc4ba.js:71:24)
    at localRequire (index.ac9dc4ba.js:84:35)
    at bo80H.@lezer/javascript (index.ac9dc4ba.js:25447:19)
    at newRequire (index.ac9dc4ba.js:71:24)
    at localRequire (index.ac9dc4ba.js:84:35)
    at aR1JP../styles.css (index.ac9dc4ba.js:582:23)

Reverting the @lezer/javascript to v1.4.11 works with no error, that's why I guess is related to the lezer. I also have no problems with other languages (html, sass)

I put a minimal test here
if you comment the import { javascript } from "@codemirror/lang-javascript"; line, there is no error

Here is a screenshot since codesandbox sometimes doesn't display the error, it just fails silently
2024-01-16_16-08

Hi, I have a strange error since v1.4.12: just importing lang-javascript fails with this: ``` Uncaught TypeError: Cannot read properties of undefined (reading 'deserialize') at setProp (index.ac9dc4ba.js:27819:22) at new LRParser (index.ac9dc4ba.js:27830:51) at LRParser.deserialize (index.ac9dc4ba.js:28028:16) at dv8xE.@lezer/lr (index.ac9dc4ba.js:26252:34) at newRequire (index.ac9dc4ba.js:71:24) at localRequire (index.ac9dc4ba.js:84:35) at bo80H.@lezer/javascript (index.ac9dc4ba.js:25447:19) at newRequire (index.ac9dc4ba.js:71:24) at localRequire (index.ac9dc4ba.js:84:35) at aR1JP../styles.css (index.ac9dc4ba.js:582:23) ``` Reverting the @lezer/javascript to v1.4.11 works with no error, that's why I guess is related to the lezer. I also have no problems with other languages (html, sass) I put a minimal test [here](https://codesandbox.io/p/devbox/codemirror-6-55p3pz?file=%2Fsrc%2Findex.mjs) if you comment the `import { javascript } from "@codemirror/lang-javascript";` line, there is no error Here is a screenshot since codesandbox sometimes doesn't display the error, it just fails silently ![2024-01-16_16-08](https://github.com/lezer-parser/javascript/assets/15734521/f1ffdbd7-e4e9-466f-9724-8170a0694d22)
marijnh commented 2024-01-16 16:43:13 +01:00 (Migrated from github.com)

Can you confirm that @lezer/common is deduplicated (only occurs once in npm ls -a) and is on version 1.2.0 or higher?

Can you confirm that @lezer/common is deduplicated (only occurs once in `npm ls -a`) and is on version 1.2.0 or higher?
marijnh commented 2024-01-16 16:45:17 +01:00 (Migrated from github.com)

It seems I forgot to add the dependency on @lezer/common 1.2.0 when I updated this package. Version 1.4.13 should fix that.

It seems I forgot to add the dependency on @lezer/common 1.2.0 when I updated this package. Version 1.4.13 should fix that.
lianee commented 2024-01-16 16:56:35 +01:00 (Migrated from github.com)

Whoa, that was fast.
Works great, thanks a lot

Whoa, that was fast. Works great, thanks a lot
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
lezer/javascript#29
No description provided.