Error executing lua [string ":lua"]:3: module 'lspconfig' not found
Blayung opened this issue · 7 comments
Warning: I will close the issue without the minimal init.vim and the
reproduction instructions.
Problems summary
Basically, this error is self-explainatory: Error executing lua [string ":lua"]:3: module 'lspconfig' not found
Expected
No error!
Environment Information (Required!)
-
dein.vim version(SHA1): I don't use dein.vim.
-
OS: Arch Linux
-
neovim/Vim
:version
output:
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
Provide a minimal init.vim/vimrc without plugin managers (Required!)
" - my plugins - "
"""""""""""""""""""""
lua << EOF
-- LSP
require('lspconfig')['pyright'].setup() {}
-- TROUBLE
require('trouble').setup() {}
EOF
"Looks
let g:codedark_transparent=1
colorscheme codedark
let g:airline_powerline_fonts = 1
let g:airline_theme='codedark'
"set background=light
set number
set relativenumber
"Tabulators
set smartindent
set tabstop=4
set expandtab
set shiftwidth=4
"Key bindings
set mouse=a
nmap <F2> :NERDTreeToggle<CR>
nmap <S-Left> gT
nmap <S-Right> gt
inoremap <silent><expr> <S-tab> coc#pum#visible() ? coc#pum#confirm() : "\<C-y>"
"Misc
let NERDTreeCustomOpenArgs={'file':{'where': 't'}}
filetype plugin on
set clipboard=unnamedplus
set incsearch
How to reproduce the problem from neovim/Vim startup (Required!)
- Have my neo vim config.
- Run neo vim.
Screen shot (if possible)
Upload the log messages by :redir
and :message
(if errored)
Error detected while processing /home/wojtek/.config/nvim/init.vim:
line 22:
E5108: Error executing lua [string ":lua"]:3: module 'lspconfig' not found:
no field package.preload['lspconfig']
no file './lspconfig.lua'
no file '/usr/share/luajit-2.1.0-beta3/lspconfig.lua'
no file '/usr/local/share/lua/5.1/lspconfig.lua'
no file '/usr/local/share/lua/5.1/lspconfig/init.lua'
no file '/usr/share/lua/5.1/lspconfig.lua'
no file '/usr/share/lua/5.1/lspconfig/init.lua'
no file './lspconfig.so'
no file '/usr/local/lib/lua/5.1/lspconfig.so'
no file '/usr/lib/lua/5.1/lspconfig.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
[string ":lua"]:3: in main chunk
Please upload your init.vim
.
It seems you have called lspconfig
before loading.
" - my plugins - "
"""""""""""""""""""""
lua << EOF
-- LSP
require('lspconfig')['pyright'].setup() {}
-- TROUBLE
require('trouble').setup() {}
EOF
"Looks
let g:codedark_transparent=1
colorscheme codedark
let g:airline_powerline_fonts = 1
let g:airline_theme='codedark'
"set background=light
set number
set relativenumber
"Tabulators
set smartindent
set tabstop=4
set expandtab
set shiftwidth=4
"Key bindings
set mouse=a
nmap <F2> :NERDTreeToggle<CR>
nmap <S-Left> gT
nmap <S-Right> gt
inoremap <silent><expr> <S-tab> coc#pum#visible() ? coc#pum#confirm() : "\<C-y>"
"Misc
let NERDTreeCustomOpenArgs={'file':{'where': 't'}}
filetype plugin on
set clipboard=unnamedplus
set incsearch
It is invalid config. Because it does not use dein functions.
Why you have created issue without dein functions?
For example,
call plug#begin('~/.nvim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tomasiser/vim-code-dark'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug 'ryanoasis/vim-devicons'
call plug#end()
"""""""""""""""""""""
After call plug#end()
, you can call plugins functions. Because call dein#end()
loads plugins.
It is vim-plug
's feature.
For dein.vim
, call dein#begin()
/call dein#end()
block is needed.
I didn't know, that it had meaning, but I had my lua code in between call plug#begin() and call plug#end().
Wait... I didn't put this issue where I wanted! It was supposed to be in neovim/nvim-lspconfig! Sorry!
What plugin manager do you use?
It is not plugin problem.
It is just your mis configuration.
Yep, but I didn't know about that + I use vim plug.