E5113: Error while calling lua chunk: ./tokyonight.lua

I’m new to neovim and I’m going through a configuration tutorial but when I entered neovim I recieved this error about the colorscheme tokoynight:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Error detected while processing /Users/<user>/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ./tokyonight.lua:1: loop or previous error loading module 'tokyonight'
stack traceback:
[C]: in function 'require'
./tokyonight.lua:1: in main chunk
[C]: in function 'require'
...<user>/.config/nvim/lua/core/plugins_config/tokyonight.lua:1: in main chunk
[C]: in function 'require'
...rs/<user>/.config/nvim/lua/core/plugins_config/init.lua:3: in main chunk
[C]: in function 'require'
/Users/<user>/.config/nvim/init.lua:3: in main chunk
Press ENTER or type command to continue
</code>
<code>Error detected while processing /Users/<user>/.config/nvim/init.lua: E5113: Error while calling lua chunk: ./tokyonight.lua:1: loop or previous error loading module 'tokyonight' stack traceback: [C]: in function 'require' ./tokyonight.lua:1: in main chunk [C]: in function 'require' ...<user>/.config/nvim/lua/core/plugins_config/tokyonight.lua:1: in main chunk [C]: in function 'require' ...rs/<user>/.config/nvim/lua/core/plugins_config/init.lua:3: in main chunk [C]: in function 'require' /Users/<user>/.config/nvim/init.lua:3: in main chunk Press ENTER or type command to continue </code>
Error detected while processing /Users/<user>/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ./tokyonight.lua:1: loop or previous error loading module 'tokyonight'
stack traceback:
        [C]: in function 'require'
        ./tokyonight.lua:1: in main chunk
        [C]: in function 'require'
        ...<user>/.config/nvim/lua/core/plugins_config/tokyonight.lua:1: in main chunk
        [C]: in function 'require'
        ...rs/<user>/.config/nvim/lua/core/plugins_config/init.lua:3: in main chunk
        [C]: in function 'require'
        /Users/<user>/.config/nvim/init.lua:3: in main chunk
Press ENTER or type command to continue

Here’s my configuration:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>~/.config/nvim/..
lua/
core/
plugins_config/
init.lua
lualine.lua
nvim-tree.lua
tokyonight.lua -- tokyonight --
keymaps.lua
plugins.lua
plugin/
packer_compilied.lua
init.lua
</code>
<code>~/.config/nvim/.. lua/ core/ plugins_config/ init.lua lualine.lua nvim-tree.lua tokyonight.lua -- tokyonight -- keymaps.lua plugins.lua plugin/ packer_compilied.lua init.lua </code>
~/.config/nvim/..
lua/
   core/
      plugins_config/
         init.lua
         lualine.lua
         nvim-tree.lua
         tokyonight.lua -- tokyonight --
      keymaps.lua
      plugins.lua
plugin/
   packer_compilied.lua
init.lua

Here’s my first init.lua:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>require("core.keymaps")
require("core.plugins")
require("core.plugins_config")
</code>
<code>require("core.keymaps") require("core.plugins") require("core.plugins_config") </code>
require("core.keymaps")
require("core.plugins")
require("core.plugins_config")

Second init.lua:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>require("core.plugins_config.lualine")
require("core.plugins_config.nvim-tree")
require("core.plugins_config.tokyonight") -- tokyonight --
</code>
<code>require("core.plugins_config.lualine") require("core.plugins_config.nvim-tree") require("core.plugins_config.tokyonight") -- tokyonight -- </code>
require("core.plugins_config.lualine")
require("core.plugins_config.nvim-tree")
require("core.plugins_config.tokyonight") -- tokyonight --

plugins.lua

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https:github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'nvim-tree/nvim-tree.lua'
use 'nvim-tree/nvim-web-devicons'
use nvim-lualine/lualine.nvim'
use 'folke/tokyonight.nvim' -- tokyonight --
if packer_bootstrap then
require('packer').sync()
end
end)
</code>
<code>local ensure_packer = function() local fn = vim.fn local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' if fn.empty(fn.glob(install_path)) > 0 then fn.system({'git', 'clone', '--depth', '1', 'https:github.com/wbthomason/packer.nvim', install_path}) vim.cmd [[packadd packer.nvim]] return true end return false end local packer_bootstrap = ensure_packer() return require('packer').startup(function(use) use 'wbthomason/packer.nvim' use 'nvim-tree/nvim-tree.lua' use 'nvim-tree/nvim-web-devicons' use nvim-lualine/lualine.nvim' use 'folke/tokyonight.nvim' -- tokyonight -- if packer_bootstrap then require('packer').sync() end end) </code>
local ensure_packer = function()
   local fn = vim.fn
   local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
   if fn.empty(fn.glob(install_path)) > 0 then
      fn.system({'git', 'clone', '--depth', '1', 'https:github.com/wbthomason/packer.nvim', install_path})
      vim.cmd [[packadd packer.nvim]]
      return true
   end
   return false
end

local packer_bootstrap = ensure_packer()

return require('packer').startup(function(use)
   use 'wbthomason/packer.nvim'
   use 'nvim-tree/nvim-tree.lua'
   use 'nvim-tree/nvim-web-devicons'
   use nvim-lualine/lualine.nvim'
   use 'folke/tokyonight.nvim' -- tokyonight --

   if packer_bootstrap then
      require('packer').sync()
   end
end)

and lastly tokyonight.lua

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>require("tokyonight").setup({
style = "night",
terminal_colors = true,
})
</code>
<code>require("tokyonight").setup({ style = "night", terminal_colors = true, }) </code>
require("tokyonight").setup({
   style = "night",
   terminal_colors = true,
})

I appreciate if anyone has advice or a solution 🙂

I saw that forums said something in regards to setting the configuration before loading the color scheme, but I’m not sure what this entails.

New contributor

Seth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật