Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module 'string.buffer' not found #1126

Closed
fl0r3k opened this issue Sep 27, 2024 · 3 comments · May be fixed by #1040
Closed

Module 'string.buffer' not found #1126

fl0r3k opened this issue Sep 27, 2024 · 3 comments · May be fixed by #1040
Labels
bug Something isn't working

Comments

@fl0r3k
Copy link

fl0r3k commented Sep 27, 2024

Description

I was using gitsigns for some time now without a problem. Today, when I encountered this error:

Neovim 0.11.0-dev
Lazyvim installation

Neovim version

NVIM v0.11.0-dev

Operating system and version

WSL2 Ubuntu 22.04.5 LTS

Expected behavior

gitsigns loads correctly

Actual behavior

When opening any file that is tracked by git:

Error executing vim.schedule lua callback: ...ns_issue/gitsigns_issue/gitsigns//lua/gitsigns/async.lua:95: The async coroutine failed: ...issue/gitsigns_issue/gitsigns//lua/gitsigns/diff_int.lua:8: module 'string.buffer' not found:
        no field package.preload['string.buffer']
        no file './string/buffer.lua'
        no file '/usr/share/luajit-2.1.0-beta3/string/buffer.lua'
        no file '/usr/local/share/lua/5.1/string/buffer.lua'
        no file '/usr/local/share/lua/5.1/string/buffer/init.lua'
        no file '/usr/share/lua/5.1/string/buffer.lua'
        no file '/usr/share/lua/5.1/string/buffer/init.lua'
        no file './string/buffer.so'
        no file '/usr/local/lib/lua/5.1/string/buffer.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/string/buffer.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './string.so'
        no file '/usr/local/lib/lua/5.1/string.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/string.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        ...gns_issue/gitsigns_issue/gitsigns//lua/gitsigns/diff.lua:21: in function 'run_diff'
        ..._issue/gitsigns_issue/gitsigns//lua/gitsigns/manager.lua:472: in function 'fn'
        ...issue/gitsigns_issue/gitsigns//lua/gitsigns/debounce.lua:68: in function 'update'
        ...s_issue/gitsigns_issue/gitsigns//lua/gitsigns/attach.lua:366: in function 'fn'
        ...issue/gitsigns_issue/gitsigns//lua/gitsigns/debounce.lua:68: in function 'attach_throttled'
        ...s_issue/gitsigns_issue/gitsigns//lua/gitsigns/attach.lua:431: in function <...s_issue/gitsigns_issue/gitsigns//lua/gitsigns/attach.lua:430>
stack traceback:
        [C]: in function 'error'
        ...ns_issue/gitsigns_issue/gitsigns//lua/gitsigns/async.lua:95: in function 'cb'
        ...ns_issue/gitsigns_issue/gitsigns//lua/gitsigns/async.lua:145: in function <...ns_issue/gitsigns_issue/gitsigns//lua/gitsigns/async.lua:144>

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} do
local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
if vim.fn.isdirectory(install_path) == 0 then
vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
end
vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
  -- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. mkdir gitsigns_issue
  2. cd gitsigns_issue
  3. git init
  4. touch file
  5. git add file
  6. git commit -m 'initial commit'
  7. nvim --clean -u minimal.lua file
  8. ...

Gitsigns debug messages

1.84 D dprintf: Deriving GitSignsAdd from Added
1.87 D derive: Deriving GitSignsChange from Changed
1.92 D derive: Deriving GitSignsDelete from Removed
1.95 D derive: Deriving GitSignsChangedelete from GitSignsChange
1.98 D derive: Deriving GitSignsTopdelete from GitSignsDelete
1.99 D derive: Deriving GitSignsUntracked from GitSignsAdd
2.02 D derive: Deriving GitSignsAddNr from GitSignsAdd
2.03 D derive: Deriving GitSignsChangeNr from GitSignsChange
2.08 D derive: Deriving GitSignsDeleteNr from GitSignsDelete
2.09 D derive: Deriving GitSignsChangedeleteNr from GitSignsChangeNr
2.11 D derive: Deriving GitSignsTopdeleteNr from GitSignsDeleteNr
2.13 D derive: Deriving GitSignsUntrackedNr from GitSignsAddNr
2.15 D derive: Deriving GitSignsAddLn from DiffAdd
2.17 D derive: Deriving GitSignsChangeLn from DiffChange
2.19 D derive: Deriving GitSignsChangedeleteLn from GitSignsChangeLn
2.21 D derive: Deriving GitSignsUntrackedLn from GitSignsAddLn
2.22 D derive: Deriving GitSignsAddCul from GitSignsAdd
2.23 D derive: Deriving GitSignsChangeCul from GitSignsChange
2.25 D derive: Deriving GitSignsDeleteCul from GitSignsDelete
2.26 D derive: Deriving GitSignsChangedeleteCul from GitSignsChangeCul
2.27 D derive: Deriving GitSignsTopdeleteCul from GitSignsDeleteCul
2.29 D derive: Deriving GitSignsUntrackedCul from GitSignsAddCul
2.30 D derive: Deriving GitSignsStagedAdd from GitSignsAdd
2.35 D derive: Deriving GitSignsStagedChange from GitSignsChange
2.38 D derive: Deriving GitSignsStagedDelete from GitSignsDelete
2.39 D derive: Deriving GitSignsStagedChangedelete from GitSignsChangedelete
2.41 D derive: Deriving GitSignsStagedTopdelete from GitSignsTopdelete
2.43 D derive: Deriving GitSignsStagedAddNr from GitSignsAddNr
2.45 D derive: Deriving GitSignsStagedChangeNr from GitSignsChangeNr
2.46 D derive: Deriving GitSignsStagedDeleteNr from GitSignsDeleteNr
2.48 D derive: Deriving GitSignsStagedChangedeleteNr from GitSignsChangedeleteNr
2.50 D derive: Deriving GitSignsStagedTopdeleteNr from GitSignsTopdeleteNr
2.52 D derive: Deriving GitSignsStagedAddLn from GitSignsAddLn
2.53 D derive: Deriving GitSignsStagedChangeLn from GitSignsChangeLn
2.55 D derive: Could not derive GitSignsStagedDeleteLn
2.58 D derive: Deriving GitSignsStagedChangedeleteLn from GitSignsChangedeleteLn
2.59 D derive: Could not derive GitSignsStagedTopdeleteLn
2.61 D derive: Deriving GitSignsStagedAddCul from GitSignsAddCul
2.65 D derive: Deriving GitSignsStagedChangeCul from GitSignsChangeCul
2.67 D derive: Deriving GitSignsStagedDeleteCul from GitSignsDeleteCul
2.68 D derive: Deriving GitSignsStagedChangedeleteCul from GitSignsChangedeleteCul
2.70 D derive: Deriving GitSignsStagedTopdeleteCul from GitSignsTopdeleteCul
2.72 D derive: Deriving GitSignsAddPreview from DiffAdd
2.74 D derive: Deriving GitSignsDeletePreview from DiffDelete
2.75 D derive: Deriving GitSignsCurrentLineBlame from NonText
2.77 D derive: Deriving GitSignsAddInline from TermCursor
2.78 D derive: Deriving GitSignsDeleteInline from TermCursor
2.80 D derive: Deriving GitSignsChangeInline from TermCursor
2.84 D derive: Deriving GitSignsAddLnInline from GitSignsAddInline
2.85 D derive: Deriving GitSignsChangeLnInline from GitSignsChangeInline
2.88 D derive: Deriving GitSignsDeleteLnInline from GitSignsDeleteInline
2.90 D derive: Deriving GitSignsDeleteVirtLn from DiffDelete
2.92 D derive: Deriving GitSignsDeleteVirtLnInLine from GitSignsDeleteLnInline
2.94 D derive: Deriving GitSignsVirtLnum from GitSignsDeleteVirtLn
19.23 D attach(1): Attaching (trigger=BufReadPost)
19.39 D run_job: git --version
26.93 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
29.32 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /home/fl0r3k/gitsigns_issue/.git config user.name
31.25 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /home/fl0r3k/gitsigns_issue/.git -c core.quotepath=off ls-files --stage --others --exclude-standard --eol /home/fl0r3k/gitsigns_issue/file
35.74 D watch_gitdir(1): Watching git dir
35.86 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /home/fl0r3k/gitsigns_issue/.git show e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
14900.98 D cli.run: Running action 'debug_messages' with arguments {}
40419.50 D cli.run: Running action 'debug_messages' with arguments {}
130150.74 D cli.run: Running action 'debug_messages' with arguments {}
147941.87 D cli.run: Running action 'debug_message' with arguments {}
164450.30 D cli.run: Running action 'debug_messages' with arguments {}

Gitsigns cache

{ {
    bufnr = 1,
    compare_text = { "...",
      head = "",
      length = 1
    },
    file = "/home/fl0r3k/gitsigns_issue/file",
    git_obj = {
      encoding = "utf-8",
      file = "/home/fl0r3k/gitsigns_issue/file",
      i_crlf = false,
      mode_bits = "100644",
      object_name = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
      relpath = "file",
      repo = {
        abbrev_head = "master",
        detached = false,
        gitdir = "/home/fl0r3k/gitsigns_issue/.git",
        toplevel = "/home/fl0r3k/gitsigns_issue",
        username = "fl0r3k"
      },
      w_crlf = false
    },
    gitdir_watcher = <userdata 1>,
    staged_diffs = { "...",
      length = 0
    },
    update_lock = true
  } }
@fl0r3k fl0r3k added the bug Something isn't working label Sep 27, 2024
@robertmonka
Copy link

Same issue on me.

@fl0r3k
Copy link
Author

fl0r3k commented Sep 27, 2024

Seems like the recent commit added this require statement:

233bcbf @lewis6991

I switched to 0.9.0 release and it works.
Lazy example:

{
	"lewis6991/gitsigns.nvim",
	tag = "v0.9.0",
	otps = {}
}

@lewis6991
Copy link
Owner

This happens on Neovim builds which are built with an old version of LuaJIT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants