Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree-sitter-elm.wasm not found #1052

Closed
jweir opened this issue Sep 1, 2023 · 9 comments
Closed

tree-sitter-elm.wasm not found #1052

jweir opened this issue Sep 1, 2023 · 9 comments

Comments

@jweir
Copy link

jweir commented Sep 1, 2023

Starting vim with elm-language-server 2.7.1 I get the following error:

[coc.nvim] Request initialize failed with message: ENOENT: no such file or directory, open '../../../../../../opt/homebrew/lib/node_modules/@elm-tooling/
[coc.nvim] Server languageserver.elmLS failed to start: Error: Request initialize failed with message: ENOENT: no such file or directory, open '../../../
../../../opt/homebrew/lib/node_modules/@elm-tooling/elm-language-server/out/common/tree-sitter-elm.wasm'

Current Workaround

I adjusted the path to tree-sitter-elm to the below, but this probably isn't a great solution.

        const pathToWasm = (_b = initializationOptions.treeSitterElmWasmUri) !== null && _b !== void 0 ? _b : Path.relative(process.cwd(), Path.join(__dirname, '../../out/', "tree-sitter-elm.wasm"));

Your Environment

  • Version used: 2.7.1
  • Editor used: vim + coc
  • Environment name and version (e.g. node.js 5.4): node v18.16.1
  • Operating System and version: MacOS 13.4.1
@razzeee
Copy link
Member

razzeee commented Sep 2, 2023

@Chocrates
Copy link

Same issue here with a relatively new version of NVIM. Using Packer and Mason and did a npm install -g @elm-tooling/elm-language-server though not sure that was needed.
Gonna try the workaround.
Where did you put this workaround @jweir?

@jweir
Copy link
Author

jweir commented Sep 6, 2023

@Chocrates I edited out/common/index.js line 74 under /opt/homebrew/lib/node_modules/@elm-tooling/elm-language-server/ – your location may vary.

@Chocrates
Copy link

Thanks that worked for me @jweir

@dtrckd
Copy link

dtrckd commented Sep 10, 2023

Same error here. I paste the stack I got in neovim as it is slightly different from @jweir, in case it could helps

Error executing vim.schedule lua callback: /snap/nvim/2809/usr/share/nvim/runtime/lua/vim/lsp.lua:1309: RPC[Error] code_name = InternalError, message = "Request initialize failed with message: ENOENT: no such file
or directory, open '../../../../../.nvm/versions/node/v18.4.0/lib/node_modules/@elm-tooling/elm-language-server/out/common/tree-sitter-elm.wasm'"                                                                   
stack traceback:                                                                                                                                                                                                     
       [C]: in function 'assert'                                                                                                                                                                                    
       /snap/nvim/2809/usr/share/nvim/runtime/lua/vim/lsp.lua:1309: in function ''                                                                                                                                  
       vim/_editor.lua: in function <vim/_editor.lua:0> `

@aaaaargZombies
Copy link

Just ran into same problem in Neovim using Mason for LSP business.

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp.lua:1309: RPC[Error] code_name = InternalError, message = "Request initialize fa
iled with message: ENOENT: no such file or directory, open '../../.local/share/nvim/mason/packages/elm-language-server/node_modules/@elm-tooling/elm-language-s
erver/out/common/tree-sitter-elm.wasm'"                                                                                                                        
stack traceback:                                                                                                                                               
        [C]: in function 'assert'                                                                                                                              
        /usr/share/nvim/runtime/lua/vim/lsp.lua:1309: in function ''                                                                                           
        vim/_editor.lua: in function <vim/_editor.lua:0>

I've just downgrading the package rather than messing with the source

:MasonInstall [email protected]

@seanstrom
Copy link
Contributor

I think this issue is caused by a recent refactor of the code into separate folders. For example this section of code used to be in the src directory but was refactored into the src/common directory, which likely silently changed the computed directory for the tree-sitter-elm.wasm file:

const pathToWasm =
initializationOptions.treeSitterElmWasmUri ??
Path.relative(
process.cwd(),
Path.join(__dirname, "tree-sitter-elm.wasm"),
);

At the moment, I've shared a potential fix at #1070
Please let me know what you think 🙏

@jmbockhorst
Copy link
Member

Fixed by #1070.

@razzeee
Copy link
Member

razzeee commented Sep 24, 2023

This needs a new server release to reach vim users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants