ecosse3 / nvim

A non-minimal Neovim config built to work most efficiently with Frontend Development
GNU General Public License v3.0
1.26k stars 110 forks source link

`plugins.cmp.types` failed to load - Error on startup and INSERT mode #181

Closed alarwasyi98 closed 1 month ago

alarwasyi98 commented 1 month ago

Description:

Hi there!

Thank you for the awesome Neovim configuration, I'm really enjoying using it! However, I've encountered an issue when running it on my machine. Specifically, I hope this is my mistake. I'm getting an error related to plugins.cmp.types.

Steps to Reproduce:

  1. Clone the repository and set up Neovim according to the instructions.
  2. Open Neovim, and the error appears on startup.
  3. Additionally, everytime I run nvim and whenever I enter INSERT mode, the error pops up again.

Error Message:

Error Message on Startup image Error Message Insert Mode image

System Info:

:checkhealth output:

lazy.nvim ~
- {lazy.nvim} version 11.14.1
- OK {git} version 2.46.1
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found
- ERROR Issues were reported when loading your specs:
- ERROR Failed to load plugins.cmp
- ERROR 
- ERROR /home/alarwasyi98/.config/nvim/lua/plugins/cmp.lua:1: module 'cmp.types' not found:
- ERROR     no field package.preload['cmp.types']
- ERROR cache_loader: module cmp.types not found
- ERROR cache_loader_lib: module cmp.types not found
- ERROR     no file './cmp/types.lua'
- ERROR     no file '/usr/share/luajit-2.1/cmp/types.lua'
- ERROR     no file '/usr/local/share/lua/5.1/cmp/types.lua'
- ERROR     no file '/usr/local/share/lua/5.1/cmp/types/init.lua'
- ERROR     no file '/usr/share/lua/5.1/cmp/types.lua'
- ERROR     no file '/usr/share/lua/5.1/cmp/types/init.lua'
- ERROR     no file './cmp/types.so'
- ERROR     no file '/usr/local/lib/lua/5.1/cmp/types.so'
- ERROR     no file '/usr/lib/lua/5.1/cmp/types.so'
- ERROR     no file '/usr/local/lib/lua/5.1/loadall.so'
- ERROR     no file './cmp.so'
- ERROR     no file '/usr/local/lib/lua/5.1/cmp.so'
- ERROR     no file '/usr/lib/lua/5.1/cmp.so'
- ERROR     no file '/usr/local/lib/lua/5.1/loadall.so'
- ERROR 
- ERROR # stacktrace:
- ERROR   - .config/nvim/lua/plugins/cmp.lua:1 in *load*
- ERROR   - .config/nvim/lua/config/lazy.lua:14
- ERROR   - .config/nvim/init.lua:7

Additional Notes:

I didn't change anything in the default configuration except only changed the name tsserver to ts_ls in /config/lsp/setup.lua. Any help would be appreciated!

Thanks again for the great config, and looking forward to any advice on how to resolve this!

DeepReef11 commented 1 month ago

I found a fix but I don't know the real solution.

In lua/plugins/cmp.lua, comment everything that use the var types. There's the first line and 2 functions. Exit, open it back, it will install missing cmp plugins. Go back to cmp.lua and uncomment lines (or simply undo).

DeepReef11 commented 1 month ago

I've made a pull request:

182

ecosse3 commented 1 month ago

@alarwasyi98 Does it work for you now?

alarwasyi98 commented 1 month ago

Thank you so much for your help in resolving this issue! I can confirm that the solution worked perfectly on my system. I really appreciate your quick response and assistance. @ecosse3 @DeepReef11

Thanks again!