tree-sitter-ruby icon indicating copy to clipboard operation
tree-sitter-ruby copied to clipboard

`build-wasm` fails to produce working parser

Open savetheclocktower opened this issue 2 years ago • 2 comments

This started on commit cbd998c and has affected this parser ever since.

These symptoms persist on both master and cbd998c:

tree-sitter build-wasm . && tree-sitter playground

The resulting browser window has this error in the console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'apply')
    at e.<computed> (tree-sitter.js:1:10370)
    at 007b624a:0x4130
    at tree-sitter.wasm:0x24b5b
    at Module._ts_parser_parse_wasm (tree-sitter.js:1:23097)
    at Parser.parse (tree-sitter.js:1:38110)
    at handleCodeChange (playground.js:115:28)
    at handleLanguageChange (playground.js:101:5)
    at async playground.js:78:3

My versions of tree-sitter and emcc:

$ tree-sitter --version 
tree-sitter 0.20.7 (b268e412ad4848380166af153300464e5a1cf83f)
$ emcc --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.24 (416685fb964c14cde4be3e8a45ad26d75bac3e33)

Using these same versions, 6fa6332 (parent of cbd998c) builds a working wasm file.

savetheclocktower avatar Mar 18 '23 22:03 savetheclocktower

@ahlinc informs me that this is caused by https://github.com/tree-sitter/tree-sitter/issues/1906 — so until that's fixed, the only recourse would be to alter the change in cbd998c so that it doesn't use iswupper.

savetheclocktower avatar Apr 12 '23 18:04 savetheclocktower

this is fixed on ts master now, but I'll leave it up until there's a new release

amaanq avatar Sep 21 '23 08:09 amaanq