nvim-java author here. We are trying to fix Mason 2.0 breaking changes in nvim-java and facing this error
...m/lazy/mason.nvim/lua/mason-core/functional/function.lua:46: attempt to call upvalue 'fn' (a nil value)
This is all we get when it comes to stack trace. With the help of some print statements, I found the exact API causing this issue to be get_installed_version
https://github.com/nvim-java/nvim-java/blob/d25bc1c55b4cea53f6174b2e2171ed8519113bc5/lua/java/utils/mason.lua?plain=1#L17
We have our own mason registry but it seems I could see the same error with other packages coming from default mason registry.

For instance, following throws the same error
lua require('mason-registry').get_package('vtsls'):get_installed_version()
E5108: Lua: ...m/lazy/mason.nvim/lua/mason-core/functional/function.lua:46: attempt to call upvalue 'fn' (a nil value)
stack traceback:
...m/lazy/mason.nvim/lua/mason-core/functional/function.lua:46: in function 'fn'
...cal/share/nvim/lazy/mason.nvim/lua/mason-core/result.lua:136: in function 'on_success'
...are/nvim/lazy/mason.nvim/lua/mason-core/package/init.lua:254: in function 'fn'
...l/share/nvim/lazy/mason.nvim/lua/mason-core/optional.lua:101: in function 'if_present'
...are/nvim/lazy/mason.nvim/lua/mason-core/package/init.lua:247: in function 'get_installed_version'
[string ":lua"]:1: in main chunk
At the same time, other packages throws at different locations.
lua require('mason-registry').get_package('prettier'):get_installed_version()
E5108: Lua: ...are/nvim/lazy/mason.nvim/lua/mason-core/package/init.lua:250: attempt to index field 'primary_source' (a nil value)
stack traceback:
...are/nvim/lazy/mason.nvim/lua/mason-core/package/init.lua:250: in function 'fn'
...l/share/nvim/lazy/mason.nvim/lua/mason-core/optional.lua:101: in function 'if_present'
...are/nvim/lazy/mason.nvim/lua/mason-core/package/init.lua:247: in function 'get_installed_version'
[string ":lua"]:1: in main chunk
Any clue what's going on?
nvim-java author here. We are trying to fix Mason 2.0 breaking changes in
nvim-javaand facing this errorThis is all we get when it comes to stack trace. With the help of some print statements, I found the exact API causing this issue to be get_installed_version
https://github.com/nvim-java/nvim-java/blob/d25bc1c55b4cea53f6174b2e2171ed8519113bc5/lua/java/utils/mason.lua?plain=1#L17
We have our own mason registry but it seems I could see the same error with other packages coming from default mason registry.
For instance, following throws the same error
At the same time, other packages throws at different locations.
Any clue what's going on?