lezer-parser / lezer

Dev utils and issues for the Lezer core packages
33 stars 1 forks source link

Getting `Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'deserialize')` issue in bun #51

Closed gyanaranjans closed 4 months ago

gyanaranjans commented 5 months ago

Unhandled Runtime Error TypeError: Cannot read properties of undefined (reading 'deserialize')

Call Stack setProp node_modules/@lezer/html/node_modules/@lezer/lr/dist/index.js (1585:0) new LRParser node_modules/@lezer/html/node_modules/@lezer/lr/dist/index.js (1600:0) LRParser.deserialize node_modules/@lezer/html/node_modules/@lezer/lr/dist/index.js (1841:0) eval node_modules/@lezer/html/dist/index.js (252:23) (app-pages-browser)/./node_modules/@lezer/html/dist/index.js

marijnh commented 5 months ago

Is there a pre-1.2 @lezer/common in your dependency tree? Could it be that dependencies aren't up to date and/or duplicated?

gyanaranjans commented 5 months ago

dependencies are up to date it works on node with npm or yarn but not with bun

marijnh commented 5 months ago

Bun isn't a runtime I explicitly support. Feel free to add more information if you want to debug this, but I'm going to assume this is a Bun issue for now.

MLaszczewski commented 4 months ago

I encountered a very similar error today while using Node.js.

TypeError: Cannot read properties of undefined (reading 'deserialize')
    at setProp (/node_modules/@lezer/lr/dist/index.js:1583:48)
    at new LRParser (/node_modules/@lezer/lr/dist/index.js:1598:29)
    at LRParser.deserialize (/node_modules/@lezer/lr/dist/index.js:1839:16)
    at /node_modules/@lezer/xml/dist/index.js:116:25
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadConfigFromBundledFile (/node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:68112:21)
    at async loadConfigFromFile (/node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:67967:28)
    at async resolveConfig (/node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:67579:28)
    at async _createServer (/node_modules/vite/dist/node/chunks/dep-94_H5fT6.js:64224:20)
marijnh commented 4 months ago

Make sure your dependency tree doesn't contain pre-1.2 versions of @lezer/common. The packages that depend on it properly require that version, but if your dependency manager duplicates versions I guess you can still get this error via indirect imports.