harrisoncramer/gitlab.nvim

Can't load plugin due to error in diffview

tboehler1 opened this issue · 1 comments

Prerequsities

  • I'm on the latest version of the plugin
  • I've installed the required dependencies
  • I've run :h gitlab.nvim.troubleshooting and followed the steps there

Setup Configuration and Environment

Using the packer installation instructions in the README (after fixing the comma mistake).

Bug Description

Installing the plugin and starting it with the keybindings from the README gives the following output:

Error detected while processing [...]/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ...ite/pack/packer/start/diffview.nvim/lua/diffview/lib.lua:12: attempt to index global 'DiffviewGlobal' (a nil value)
stack traceback:
        ...ite/pack/packer/start/diffview.nvim/lua/diffview/lib.lua:12: in main chunk
        [C]: in function 'require'
        ...ck/packer/start/gitlab.nvim/lua/gitlab/reviewer/init.lua:12: in main chunk
        [C]: in function 'require'
        ...m/site/pack/packer/start/gitlab.nvim/lua/gitlab/init.lua:7: in main chunk
        [C]: in function 'require'
        [...]/.config/nvim/lua/settings/gitlab.lua:1: in main chunk
        [C]: in function 'require'
        [...]/.config/nvim/lua/settings/init.lua:7: in main chunk
        [C]: in function 'require'
        [...]/.config/nvim/init.lua:135: in main chunk

Reproduction Steps

  1. Follow packer installation instructions
  2. Set up keybindings
  3. Load keybindings

Could be relalted to #94.
An issue in diffview is open but I'm not sure where the problem is sindrets/diffview.nvim#511
Since this has been reported here before I'm opening it again.

Hey @tboehler1 this is a compatibility issue that only occurs with Packer and Diffview, to get around it just require in the Diffview library before requiring Gitlab itself:

require("diffview") -- We require some global state from diffview
local gitlab = require("gitlab")
-- Your keybindings here...

This is a duplicate of #94, closing. Feel free to comment here again if you're still having issues.