sindrets / diffview.nvim

Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Other
3.74k stars 105 forks source link

Error: loop or previous error loading module 'diffview' #344

Closed Diullei closed 1 year ago

Diullei commented 1 year ago

Does anyone have any idea what's going on?

Error executing Lua callback: ...te/pack/packer/start/diffview.nvim/lua/diffview/lazy.lua:21: loop or previous error loading module 'diffview'
stack traceback:
        [C]: in function 'handler'
        ...te/pack/packer/start/diffview.nvim/lua/diffview/lazy.lua:21: in function '__get'
        ...te/pack/packer/start/diffview.nvim/lua/diffview/lazy.lua:36: in function '__index'
        ...site/pack/packer/start/diffview.nvim/plugin/diffview.lua:34: in function <...site/pack/packer/start/diffview.nvim/plugin/diffview.lua:27> 

nvim version

NVIM v0.9.0-dev-7ffe450
Build type: Release
LuaJIT 2.1.0-beta3

Theme I'm using: https://github.com/catppuccin/nvim

RizaHKhan commented 1 year ago

+1 Having the same issue. This plugin doesn't work anywhere.

sindrets commented 1 year ago

Sorry, but the information provided here is not actionable.

loop or previous error loading module 'diffview'

This means that there was previously thrown an error when trying to require this module. I need that error message before i can even try to help you. You can find previous errors in :messages.

RizaHKhan commented 1 year ago

@sindrets Does this help:

Error executing Lua callback: ...vim/site/pack/lazy/opt/diffview.nvim/lua/diffview/hl.lua:129: attempt to call field 'nvim_get_hl' (a nil value)
stack traceback:
    ...vim/site/pack/lazy/opt/diffview.nvim/lua/diffview/hl.lua:129: in function 'get_hl'
    ...vim/site/pack/lazy/opt/diffview.nvim/lua/diffview/hl.lua:166: in function 'get_hl_attr'
    ...vim/site/pack/lazy/opt/diffview.nvim/lua/diffview/hl.lua:185: in function 'get_fg'
    ...vim/site/pack/lazy/opt/diffview.nvim/lua/diffview/hl.lua:466: in function 'update_diff_hl'
    ...vim/site/pack/lazy/opt/diffview.nvim/lua/diffview/hl.lua:475: in function 'setup'
    ...m/site/pack/lazy/opt/diffview.nvim/lua/diffview/init.lua:25: in function 'init'
    ...m/site/pack/lazy/opt/diffview.nvim/lua/diffview/init.lua:260: in main chunk
cupstgo commented 1 year ago

+1 Having the same issue.

Diullei commented 1 year ago

Hey @sindrets when I go to :messages this is what I have:

Error executing Lua callback: ...te/pack/packer/start/diffview.nvim/lua/diffview/lazy.lua:21: loop or previous error loading module 'diffview'
stack traceback:
        [C]: in function 'handler'
        ...te/pack/packer/start/diffview.nvim/lua/diffview/lazy.lua:21: in function '__get'
        ...te/pack/packer/start/diffview.nvim/lua/diffview/lazy.lua:36: in function '__index'
        ...site/pack/packer/start/diffview.nvim/plugin/diffview.lua:34: in function <...site/pack/packer/start/diffview.nvim/plugin/diffview.lua:27> 

The closest issue that I found related to this problem was this one: https://github.com/sindrets/diffview.nvim/issues/200 . Do you think it's related?

sindrets commented 1 year ago

@Diullei no, that's the same error. If you're using something like nvim-notify it might be in :Notifications instead. You should try to reproduce the issue with a minimal config.

Does this help:

@RizaHkhan no, it does not. You already created an issue about this error, and I marked it as a duplicate and linked the parent issue. Read my comments in that thread to solve your problem.


I see that @Diullei is running an outdated dev build of Nvim v0.9. I suspect that you all have the same problem: you need to update Nvim to a supported stable release, or a newer nightly build. Partial versions are never supported. I use feature detection in the code to determine what version you are running such that the plugin can then accommodate for API incompatibilities between different versions. That obviously breaks if you're running a version that reports "My API has everything <=v0.9.0" when that is not the case.

When you're a nightly user, you are expected to keep your installation in sync with upstream master. The stable releases are always compatible.

sindrets commented 1 year ago

Summary:

Diullei commented 1 year ago

@sindrets you are right, I had an issue on my nix overlay that was not upgrading the nightly build correctly. Everything is working fine now, thank you for helping