Web Generation #996
-
Hello, I've been using langium to migrate an existing xtext project to langium for a while.
It seemed that esbuild didn't bundle my liquidjs templates into that generated my-language-server-worker.js file.
I really enjoy doing my job with langium and hope to get your help :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @zcy19373416, glad hear you're enjoying working with Langium :) I'm not too familiar with Instead of accessing the document directly and modifying the DOM, you should return the generated html from the command handler and let the caller site (i.e. the main JS thread) handle the DOM modification. Note that we offer an integrated set of generator tools, which can be seen here. Since it's integrated into TypeScript, you can run all the conditional logic in there that you need. However, I don't believe that the error in question is related to the generator tool used. |
Beta Was this translation helpful? Give feedback.
Hey @zcy19373416,
glad hear you're enjoying working with Langium :)
I'm not too familiar with
liquidjs
, but it seems like the library or your code try to access thewindow.document
variable in the scope of the webworker. Webworkers have a different set of APIs exposed to them compared to the JS that runs in the main thread of the window.Instead of accessing the document directly and modifying the DOM, you should return the generated html from the command handler and let the caller site (i.e. the main JS thread) handle the DOM modification.
Note that we offer an integrated set of generator tools, which can be seen here. Since it's integrated into TypeScript, you can run all the conditiona…