Allaman / nvim

Straightforward and pure Lua based Neovim configuration for my work as DevOps/Cloud Engineer with batteries included for Python, Golang, and, of course, YAML
MIT License
613 stars 69 forks source link

Getting these 3 errors in the fresh install #81

Closed Patil-Kranti closed 4 months ago

Patil-Kranti commented 4 months ago

Error 1 :-

Can not load user config: cannot open /Users/krantipatil/.nvim_config.lua: No such file or directory Error detected while processing /Users/krantipatil/.config/nvim/init.lua: Failed to load core.plugins.telescope

/Users/krantipatil/.config/nvim/lua/utils/functions.lua:69: attempt to index field 'telescope' (a nil value)

stacktrace:

Error 2 :-

Failed to run config for catppuccin

...atil/.config/nvim/lua/core/plugins/themes/catppuccin.lua:13: attempt to index field 'harpoon' (a nil value)

stacktrace:

Error 3 :-

Failed to run config for alpha-nvim

/Users/krantipatil/.config/nvim/lua/utils/functions.lua:69: attempt to index field 'telescope' (a nil value)

stacktrace:

following is the result of :checkhealth. System configuration ~

============================================================================== lazy: require("lazy.health").check()

lazy.nvim ~

Allaman commented 4 months ago

Hello, thanks for your Feedback. Can you please check again with the latest commits?

Patil-Kranti commented 4 months ago

Thanks for the update all 3 Errors got resolved but now i am getting this following error Error detected while processing /Users/krantipatil/.config/nvim/init.lua: Failed to load core.plugins.telescope

...m/lazy/telescope.nvim/lua/telescope/_extensions/init.lua:10: 'file_browser' extension doesn't exist or isn't installed: module 'telescope._extensions.file_browser' not found: ^Ino field package.preload['telescope._extensions.file_browser'] cache_loader: module telescope._extensions.file_browser not found cache_loader_lib: module telescope._extensions.file_browser not found ^Ino file './telescope/_extensions/file_browser.lua' ^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1/telescope/_extensions/file_browser.lua' ^Ino file '/usr/local/share/lua/5.1/telescope/_extensions/file_browser.lua' ^Ino file '/usr/local/share/lua/5.1/telescope/_extensions/file_browser/init.lua' ^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/telescope/_extensions/file_browser.lua' ^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/telescope/_extensions/file_browser/init.lua' ^Ino file './telescope/_extensions/file_browser.so' ^Ino file '/usr/local/lib/lua/5.1/telescope/_extensions/file_browser.so' ^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/telescope/_extensions/file_browser.so' ^Ino file '/usr/local/lib/lua/5.1/loadall.so' ^Ino file './telescope.so' ^Ino file '/usr/local/lib/lua/5.1/telescope.so' ^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/telescope.so' ^Ino file '/usr/local/lib/lua/5.1/loadall.so'

stacktrace:

Patil-Kranti commented 4 months ago

Also getting these warnings and error messages whenever any file is opened.

 Warn 08:14:19 notify.warn ...llar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp/rpc.lua:800: Spawning language server with cmd: { "lua-language-server" } failed. The language server is either not installed, missing from PATH, or not executable.  Warn 08:14:19 notify.warn ...llar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp/rpc.lua:800: Spawning language server with cmd: { "lua-language-server" } failed. The language server is either not installed, missing from PATH, or not executable.  Error 08:14:19 notify.error Error running selene: ENOENT: no such file or directory

Allaman commented 4 months ago

Hello, thanks for your valuable feedback! The first error should be fixed.

Can you please run :set filetype and :LspInfo when this warning/error occurs?

Patil-Kranti commented 4 months ago

now getting the follwing error after the latest pull. .../krantipatil/.config/nvim/lua/core/plugins/telescope.lua:83: attempt to index field 'telescope' (a nil value)

stacktrace:

Patil-Kranti commented 4 months ago

after running :set filetype got this filetype=lua in Noice prompt.

and :lspInfo gave following result Language client log: /Users/krantipatil/.local/state/nvim/lsp.log Detected filetype: lua

0 client(s) attached to this buffer:

Other clients that match the filetype: lua

Config: lua_ls filetypes: lua root directory: /Users/krantipatil/.config/nvim cmd: lua-language-server cmd is executable: Unable to find executable. Please check your path and ensure the server is installed autostart: true custom handlers:

Configured servers list: tsserver, typst_lsp, yamlls, bashls, dockerls, jsonls, gopls, helm_ls, ltex, marksman, pyright, lua_ls, terraformls, texlab

Allaman commented 4 months ago

Getting closer. Thanks for your patience. Please take a look at the latest commit.

Thanks for your input. What file do you have opened? Neovim thinks that this is a Lua file, but you said that it happens on all files? Can you attach a "minimal not working" example file?

Patil-Kranti commented 4 months ago

thanks the latest commit fixed the telescope errors.

I had telescope.lua opened while i got the previous error

but it shows the same message for lsp for go or any otherfile type.

the following message i get when opening a simple go file ...llar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp/rpc.lua:800: Spawning language server with cmd: { "gopls" } failed. The language server is either not installed, missing from PATH, or not executable.

here is the code in the main.go file

package main

import ( "fmt" )

func main() {

fmt.Println("Hello World");

}

here is the :LspInfo result for the same go file:

Language client log: /Users/krantipatil/.local/state/nvim/lsp.log Detected filetype: go

0 client(s) attached to this buffer:

Other clients that match the filetype: go

Config: gopls filetypes: go, gomod, gowork, gotmpl root directory: /Users/krantipatil/Projects/Go/trash cmd: gopls cmd is executable: Unable to find executable. Please check your path and ensure the server is installed autostart: true custom handlers:

Configured servers list: yamlls, bashls, dockerls, jsonls, gopls, helm_ls, ltex, marksman, pyright, lua_ls, terraformls, texlab, tsserver, typst_lsp

Allaman commented 4 months ago

Ahh, this is not "the same error on every file", so I was a little confused 😄

cmd: { "lua-language-server" } failed.

this indicates that the LSP (lua-language-lsp in this case) is missing when having opened telescope.lua(a lua file)

cmd: { "gopls" } failed.

this indicates that the LSP (gopls in this cae) is missing when having opened main.go(a Go file)

Have you seen the requirements in the README, especially this? Mason is responsible for installing additional tools like gopls and lua-language-server. If you don't need the default LSPs, you can overwrite it in your user config.

Patil-Kranti commented 4 months ago

yes I have mason installed all the requirements

Screenshot 2024-05-05 at 8 25 54 PM Screenshot 2024-05-05 at 8 26 07 PM
Allaman commented 4 months ago

hmm, can you check your PATH, both from your normal terminal and from a Neovim terminal? According to the Mason doc it should update the PATH itself.

image

However, as I want the tools installed by Mason not only available in Neovim I added this to my .zshrc [ -d $HOME/.local/share/nvim/mason/bin ] && export PATH=$PATH:$HOME/.local/share/nvim/mason/bin

Patil-Kranti commented 4 months ago

[ -d $HOME/.local/share/nvim/mason/bin ] && export PATH=$PATH:$HOME/.local/share/nvim/mason/bin

running this and opening the file doesn't give any errors.

Patil-Kranti commented 4 months ago

adding mason to my $PATH worked. Thanks for the help and loving the config till now. again thanks for all the help

Allaman commented 4 months ago

Thank you for your feedback and patience!