Himujjal / tree-sitter-svelte

Tree sitter grammar for Svelte
MIT License
77 stars 15 forks source link

npm run ui fails on Fedora Silverblue 36 (Wayland) #28

Closed aral closed 1 year ago

aral commented 2 years ago

Running npm run ui (with emcc on my path), gives the following output:

> tree-sitter-svelte@0.10.1 ui
> tree-sitter build-wasm && tree-sitter web-ui

Started playground on: http://127.0.0.1:8000
F: X11 socket /tmp/.X11-unix/X0 does not exist in filesystem, trying to use abstract socket instead.

In the browser (tested on Firefox and Ungoogled Chromium), I get the following errors:

RuntimeError: abort(Assertion failed: undefined). Build with -s ASSERTIONS=1 for more info.
    oe http://127.0.0.1:8000/tree-sitter.js:1
    k http://127.0.0.1:8000/tree-sitter.js:1
    he http://127.0.0.1:8000/tree-sitter.js:1
    xe http://127.0.0.1:8000/tree-sitter.js:1
    TreeSitter http://127.0.0.1:8000/tree-sitter.js:1
playground.js:90:17
    handleLanguageChange http://127.0.0.1:8000/playground.js:90
Uncaught (in promise) Error: Parsing failed
    parse http://127.0.0.1:8000/tree-sitter.js:1
    handleCodeChange http://127.0.0.1:8000/playground.js:115
    it https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
    jn https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
    Gn https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
    Gn https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
    Gn https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
    Gn https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
    Xn https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
    poll https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
    init https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js:1
tree-sitter.js:1:35116
Uncaught TypeError: tree is undefined
    handleCursorMovement http://127.0.0.1:8000/playground.js:326
    later http://127.0.0.1:8000/playground.js:453
playground.js:326:18
    handleCursorMovement http://127.0.0.1:8000/playground.js:326
    later http://127.0.0.1:8000/playground.js:453

Wondering if this is a Wayland-related issue as the web ui appears to be attempting to do some sort of X11 forwarding?

System information

Node version: 18.4.0
emcc version: emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.15 (8b4443a87f5eab5dbb9adb690f9ebed0a9da4bd9)
OS: Ubuntu 22.04 LTS x86_64 (running in container on Fedora Silverblue 36)
Host: B550I AORUS PRO AX 
Kernel: 5.17.12-300.fc36.x86_64 
Uptime: 1 day, 21 hours, 1 min 
Packages: 1017 (dpkg), 58 (flatpak) 
Shell: fish 3.4.1 
Resolution: 3840x2160 
DE: GNOME 
Theme: Adwaita [GTK2/3] 
Icons: Adwaita [GTK2/3] 
CPU: AMD Ryzen 7 5700G with Radeon Graphics (16) @ 3.800GHz 
GPU: AMD ATI 07:00.0 Cezanne 
Memory: 6930MiB / 63710MiB 
Himujjal commented 2 years ago

Thanks for the issue. I will check on it and resolve it further.

aral commented 2 years ago

Thanks, @Himujjal; appreciate it :)

Himujjal commented 2 years ago

Seem to be an issue with https://github.com/tree-sitter/tree-sitter/issues/1098

I will keep this issue meanwhile. Tree-sitter is not 1.0 software yet. Probably these edge cases don't work. When I last tried the ui part, it was working flawlessly.

aral commented 2 years ago

@Himujjal Thanks for investigating it.

Himujjal commented 1 year ago

Closing this issue @aral as of now.

Lets meet again, when the aforementioned https://github.com/tree-sitter/tree-sitter/issues/1098 & https://github.com/tree-sitter/tree-sitter/issues/1829 issue is resolved.

By the way the generated WASM is already in the repo, You can check once.