Skip to content

"Org.so is not a valid Win32 application" error #953

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

Closed
ColAlexsanders opened this issue Mar 28, 2025 · 15 comments
Closed

"Org.so is not a valid Win32 application" error #953

ColAlexsanders opened this issue Mar 28, 2025 · 15 comments

Comments

@ColAlexsanders
Copy link

I've been having this issue for a few weeks now, but this week I had some time to sit down and troubleshoot it further. Unfortunately, I am still trying to troubleshoot it, and I am out of ideas. I am writing this post because I want to understand what is actually happening here with potential fixes. Whenever I try to install the treesitter parser for orgmode (which automatically starts everytime I load neovim), I get an error, which is as follows:

`Error detected while processing User Autocommands for "VeryLazy":
Error executing vim.schedule lua callback: ...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'org': uv_dlopen: C:/%USERNAME%/AppData/Local/nvim-data/lazy/orgmode/parser/org.so is not a valid Win32 application.

stack traceback:
[C]: in function '_ts_add_language'
...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:112: in function 'add'
...ta/lazy/orgmode/lua/orgmode/utils/treesitter/install.lua:277: in function 'fn'
vim/_editor.lua:351: in function <vim/_editor.lua:350>
[C]: in function 'wait'
...cal/nvim-data/lazy/orgmode/lua/orgmode/utils/promise.lua:283: in function 'install_grammar'
...ppData/Local/nvim-data/lazy/orgmode/lua/orgmode/init.lua:122: in function 'setup'
C:\Users\Alex\AppData\Local\nvim/lua/plugins.lua:91: in function 'config'
.../Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/loader.lua:380: in function <.../Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/loader.lua:378>
[C]: in function 'xpcall'
...ta/Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/util.lua:135: in function 'try'
.../Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/loader.lua:395: in function 'config'
.../Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/loader.lua:362: in function '_load'
.../Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/loader.lua:197: in function 'load'
...nvim-data/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:85: in function <...nvim-data/lazy/lazy.nvim/lua/lazy/core/handler/event.lua:72>
[C]: in function 'nvim_exec_autocmds'
...ta/Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/util.lua:175: in function <...ta/Local/nvim-data/lazy/lazy.nvim/lua/lazy/core/util.lua:169>`

My guess is that that somehow when the orgmode plugin tries to install the org parser, it is a corrupted version of it. I've also tried following the installation method https://github.com/milisims/tree-sitter-org and was able to get the parser inside of the treesitter directory inside of the nvim-data dir, but that still didn't work either. All of my plugins are up to date, and I am using lazy.nvim as my package manager. Let me know if you need anything else.

@kristijanhusak
Copy link
Member

What happens when you run :Org install_treesitter_grammar ?

@ColAlexsanders
Copy link
Author

I get a similar error, and an option to reinstall treesitter grammar.

``Error executing vim.schedule lua callback: ...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'org': uv_dlopen: C:/%USERNAME%/AppData/Local/nvim-data/lazy/orgmode/parser/org.so is not a valid Win32 application.

stack traceback:
[C]: in function '_ts_add_language'
...eovim/share/nvim/runtime/lua/vim/treesitter/language.lua:112: in function 'add'
...ta/lazy/orgmode/lua/orgmode/utils/treesitter/install.lua:277: in function 'fn'
vim/_editor.lua:351: in function <vim/_editor.lua:350>
[C]: in function 'wait'
...cal/nvim-data/lazy/orgmode/lua/orgmode/utils/promise.lua:283: in function 'install_grammar'
.../Local/nvim-data/lazy/orgmode/lua/orgmode/org/global.lua:66: in function <.../Local/nvim-data/lazy/orgmode/lua/orgmode/org/global.lua:65>``

I have selected yes on the treesitter grammar reinstall prompt, and the error persists.

@kristijanhusak
Copy link
Member

Do you have any other tree-sitter grammars installed through nvim-treesitter ?

@ColAlexsanders
Copy link
Author

I do. Here is what I have:

Image

I installed all of these through :TSInstall

@kristijanhusak
Copy link
Member

Which Neovim version are you on?

@ColAlexsanders
Copy link
Author

Image

@kristijanhusak
Copy link
Member

Just to confirm it's not a compiler issue, can you uninstall one of the language and install it again? For example: :TSUninstall vim + :TSInstall vim.

@ColAlexsanders
Copy link
Author

Sure thing!

Image

Image

I don't know if there is a log output of this but the reinstall looked successful

@kristijanhusak
Copy link
Member

Can you correctly open a vim file without any errors? If yes, then lets try this:

  1. Get the path to the compiled parser directory with this command:
    :lua= vim.fs.joinpath(vim.fn.stdpath('cache'), 'tree-sitter-org')
    
  2. Open that location in the File explorer, and copy parser.so from it to the directory where orgmode is installed. From the first comment, it should be somewhere like this: C:/%USERNAME%/AppData/Local/nvim-data/lazy/orgmode/parser/org.so. Do a manual copy to this location, and rename parser.so to org.so.
  3. Let me know if it works or not.

Also, if it does not work, please try the minimal init provided.

  1. Go to C:/%USERNAME%/AppData/Local/nvim-data/lazy/orgmode
  2. do nvim -u scripts/minimal_init.lua

@ColAlexsanders
Copy link
Author

Both of those didn't work for me. Got the same error messages as before, even when the minimal_init.lua script.

@kristijanhusak
Copy link
Member

Did you confirm that vim files are working fine after the reinstallation of the parser?

Also, for nvim-treesitter, do you use a specific compiler or you let it pick one automatically?

@ColAlexsanders
Copy link
Author

I created a file called 'test.vim' in my downloads directory, and got no treesitter errors when opening it, and the bindings that I have configured for treesitter (init_selection, etc.) are working still.

For my nvim-treesitter compiler, I use clang.

@kristijanhusak
Copy link
Member

For my nvim-treesitter compiler, I use clang.

Ok, lets try this. Do this before the orgmode setup call:

require('orgmode.utils.treesitter.install').compilers = {'clang'}
-- Setup
require('orgmode').setup()

Reinstall the grammar with :Org install_treesitter_grammar.

@ColAlexsanders
Copy link
Author

ColAlexsanders commented Mar 28, 2025

Looks like it's working! I was able to use the TSToggle highlight command. Running the :Org install_treesitter_grammar command manually made it work. Thank you!

@kristijanhusak
Copy link
Member

Awesome! I'll add some documentation to Troubleshooting section in case someone else runs into a similar issue.

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

2 participants