Closed sebastinez closed 1 year ago
Just did some tests to highlight code with the tree-sitter CLI and works great, so it's either a version mismatch or something between the web bindings and the parser?
This happens when a Tree-sitter parser uses an external scanner and that scanner uses any C/C++ stdlib function that web-tree-sitter is unaware of. Right now, the only workaround is to build a custom web-tree-sitter; this page explains how we do it in the Pulsar project.
tree-sitter#949 and tree-sitter#1906 are the relevant issues. The long-term fix is described in a comment on the latter ticket. The short-term fix for tree-sitter (IMO) is to figure out how to show the user a better error message, and the short-term fix for individual parsers is to rewrite their scanners so that they don't use any functions that aren't in this list of exports.
Thank you very much @savetheclocktower this looks very promising to resolve my issue!
Will get back to you here if that's the case
Okay just had to try it out and works like a gem π tyvm π
Hi @Himujjal,
Great work on the library, and looking great on nvim. In my case I'm trying to get it to work with the web bindings in a Svelte app, and while Rust, Javascript, Typescript, C work good so far, I'm not able to run the
tree-sitter-svelte
wasm.I have built the wasm file locally with
npx tree-sitter build-wasm node_modules/tree-sitter-svelt --docker
and also tried using the one you provide in this repo, but I get the same following error.Do you have any idea whats going on? I also tried different versions of the
tree-sitter-cli
and ofemscripten
to build the wasm, also tried to generate new parsers but I don't think that's be the issue.EDIT: I get the same issue with some other pointers with
tree-sitter-html
so it could also be some version mismatch.