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

Neovim crashes after updating to v0.8.0 #683

Closed
2 tasks done
ZohnyZeyad opened this issue Dec 20, 2024 · 27 comments
Closed
2 tasks done

Neovim crashes after updating to v0.8.0 #683

ZohnyZeyad opened this issue Dec 20, 2024 · 27 comments
Labels
bug Something isn't working

Comments

@ZohnyZeyad
Copy link

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

I've just updated blink.cmp to the latest release (v0.8.0) And immediately it crashes causing all kind of issues.

Example of one of the errors once I open nvim . with Oil.

image

When I try to run :checkhealth
image

And so many different errors scattered around when I try to use nvim in general. even ctags_lsp for some reason:
image

P.S. It's my first time submitting a bug report on Github so sorry if I'm missing something / not doing it correctly.

For the time being I had to revert back to v0.7.6 until this is resolved so nvim is usable.

Relevant configuration

{
    'saghen/blink.cmp',
    version = 'v0.*',
    event = { "LspAttach" },
    -- enabled = false,
    dependencies = {
      'rafamadriz/friendly-snippets',
      'L3MON4D3/LuaSnip',
      'mikavilpas/blink-ripgrep.nvim',
    },

    opts = {
      keymap = { preset = 'default', },

      appearance = {
        use_nvim_cmp_as_default = true,
        nerd_font_variant = 'mono'
      },

      snippets = {
        expand = function(snippet)
          require('luasnip.loaders.from_vscode').lazy_load()

          require('luasnip').filetype_extend('java', { 'javadoc', 'java-tests' })
          require('luasnip').filetype_extend('scala', { 'javadoc' })
          require('luasnip').filetype_extend('sh', { 'shelldoc' })
          require('luasnip').filetype_extend('typescript', { 'tsdoc' })
          require('luasnip').filetype_extend('javascript', { 'jsdoc' })

          require('luasnip').lsp_expand(snippet)
        end,
        active = function(filter)
          if filter and filter.direction then
            return require('luasnip').jumpable(filter.direction)
          end
          return require('luasnip').in_snippet()
        end,
        jump = function(direction) require('luasnip').jump(direction) end,
      },

      sources = {
        default = function(_)
          local node = vim.treesitter.get_node()
          if vim.bo.filetype == 'lua' then
            return { 'lsp', 'luasnip', 'path' }
          elseif node and vim.tbl_contains({ 'comment', 'line_comment', 'block_comment' }, node:type()) then
            return { 'path', 'buffer' }
          else
            return { 'lsp', 'path', 'luasnip', 'buffer', 'lazydev', 'ripgrep', "cmdline" }
          end
        end,

        providers = {
          luasnip = { score_offset = -5 },

          lazydev = {
            name = 'LazyDev',
            module = 'lazydev.integrations.blink',
            fallbacks = { 'lsp' },
            score_offset = 10
          },

          ripgrep = {
            module = "blink-ripgrep",
            name = "Ripgrep",
            score_offset = -4,
            opts = {
              prefix_min_len = 3,
              context_size = 5,
              max_filesize = "1M",
              additional_rg_options = {},
              search_casing = "--smart-case",
              fallback_to_regex_highlighting = true,
            },
          },
        },
      },

      signature = {
        enabled = true,
        trigger = {
          show_on_insert_on_trigger_character = false,
        },
        window = {
          border = "rounded",
          treesitter_highlighting = true,
        }
      },

      fuzzy = {
        use_typo_resistance = false,
        use_proximity = false,
        sorts = { 'score', 'sort_text', 'kind', 'label' },
      },

      completion = {
        menu = {
          border = vim.g.border_style,
          scrollbar = false,
          draw = {
            treesitter = { 'lsp' },
            columns = { { 'kind_icon' }, { 'label', 'label_description', gap = 1 }, { 'kind' } },
          },
        },

        documentation = {
          auto_show_delay_ms = 0,
          auto_show = true,
          treesitter_highlighting = true,
          window = {
            border = "rounded",
            scrollbar = false,
          },
        },
      },
    },

    opts_extend = { 'sources.default' }
  }

neovim version

NVIM v0.10.2 Build type: Release LuaJIT 2.1.1713484068

blink.cmp version: branch, tag, or commit

v0.8.0

@ZohnyZeyad ZohnyZeyad added the bug Something isn't working label Dec 20, 2024
@jmandel1027
Copy link

I'm getting the same thing 😢

blink.cmp: require("blink.cmp.health").check()

blink.cmp healthcheck ~
- OK curl is installed
- OK git is installed
- OK Your system is supported by pre-built binaries (aarch64-apple-darwin)
- ERROR Failed to run healthcheck for "blink.cmp" plugin. Exception:
  ...local/share/nvim/lazy/blink.cmp/lua/blink/cmp/health.lua:27: bad argument #1 to 'fs_stat' (string expected, got nil)

...

lazy.nvim ~
- {lazy.nvim} version `11.16.2`
- OK {git} `version 2.47.1`
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found

  "blink-cmp-copilot": { "branch": "main", "commit": "c38d3e4201b135ab290c7ad126a9720cf76c788c" },
  "blink.cmp": { "branch": "main", "commit": "ca05bb33eb071d916d33af08cae8034c3d8002b5" },
...
  "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
  $  nvim --version
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1734355927
Run "nvim -V1 -v" for more info

@quebn
Copy link

quebn commented Dec 21, 2024

Update LazyVim to latest if you guys are using that.

@jmandel1027
Copy link

@quebn I'm on the latest Lazy.nvim and LazyVim

 ● lazy.nvim 22.97ms  init.lua
        dir     /Users/jmandel/.local/share/nvim/lazy/lazy.nvim
        url     https://github.com/folke/lazy.nvim
        version 11.16.2
        tag     stable
        branch  main
        commit  7e6c863
        readme  README.md
        help    |lazy.nvim.txt|

      ✔ [task] fetch 560.49ms
      ✔ [task] status 238.23ms
      ✔ [task] checkout 556.18ms
        HEAD is now at 7e6c863 chore(main): release 11.16.2 (#1854)
    ● LazyVim 6.49ms  start
        dir     /Users/jmandel/.local/share/nvim/lazy/LazyVim
        url     https://github.com/LazyVim/LazyVim
        version 14.6.0
        tag     stable
        branch  main
        commit  d0c366e
        readme  README.md
        help    |LazyVim.txt|

      ✔ [task] fetch 302.09ms
      ✔ [task] status 19.98ms
      ✔ [task] checkout 359.48ms
        HEAD is now at d0c366e chore(main): release 14.6.0 (#5176)

@jmandel1027
Copy link

here's my blink.cmp for completeness

 ● blink.cmp 5.23ms 󰢱 blink.cmp  nvim-lspconfig
        dir     /Users/jmandel/.local/share/nvim/lazy/blink.cmp
        url     https://github.com/saghen/blink.cmp
        version 0.8.0
        tag     v0.8.0
        branch  main
        commit  ca05bb3
        readme  README.md
        event    InsertEnter 

      ✔ [task] fetch 249.63ms
      ✔ [task] status 48.55ms
      ✔ [task] checkout 341.97ms
        HEAD is now at ca05bb3 chore: bump version to 0.8.0

@quebn
Copy link

quebn commented Dec 21, 2024

Im not using LazyVim but you could try to delete the blink.cmp directory in ~/.local/share/nvim/lazy and try to install blink.cmp again thats what worked for me, the problem might have something to do with some files within the blink.cmp (might be the binary), not being updated when updating to a new version.

@jmandel1027
Copy link

@quebn cheers mate! that did it for me!

@adudenamedruby
Copy link

@quebn 's solution worked for me as well to fix my neovim crash.

@ZohnyZeyad
Copy link
Author

Im not using LazyVim but you could try to delete the blink.cmp directory in ~/.local/share/nvim/lazy and try to install blink.cmp again thats what worked for me, the problem might have something to do with some files within the blink.cmp (might be the binary), not being updated when updating to a new version.

I'm not using any distros just plain neovim with lazy.nvim as a plugin manager. I have lazy.nvim plugin as the latest version and I've completely removed the blink.cmp directory and reinstalled it again but v0.8 seems to be still breaking nvim with the same errors above.

@quebn
Copy link

quebn commented Dec 21, 2024

make sure you've set blink version to v0.8 in your config first before removing the directory and installing it again.

@ZohnyZeyad
Copy link
Author

ZohnyZeyad commented Dec 21, 2024

make sure you've set blink version to v0.8 in your config first before removing the directory and installing it again.

Here are the steps I've done:

  • Updated Lazy.nvim and blink.cmp to latest version.
  • Closed nvim after getting the errors.
  • Removed the blink directory above (and blink-ripgrep just incase)
  • Reopened nvim.
  • While still in oil.nvim, it shows "Downloading pre-built binary" then once I click on anything, I get the same error from above.

image

@quebn
Copy link

quebn commented Dec 21, 2024

could you try waiting for the pre-built binary to finish downloading before doing anything and see what happens?

@ZohnyZeyad
Copy link
Author

could you try waiting for the pre-built binary to finish downloading before doing anything and see what happens?

Still nothing changes... :(

@SylvainGuieu
Copy link

Same thing here,
It makes nvim to crash as soon as I edit something. !
But, by removing opts = { ...} in my Lazy plugin setup , it works.
even an empty opts = {} make it fail. I am guessing opts is calling a setup.

OK:

return {
  'saghen/blink.cmp',
  -- optional: provides snippets for the snippet source
  dependencies = 'rafamadriz/friendly-snippets',
} 

NOT-OK:

return {
  'saghen/blink.cmp',
  -- optional: provides snippets for the snippet source
  dependencies = 'rafamadriz/friendly-snippets', 
 opts = {}
} 

@ZohnyZeyad
Copy link
Author

Same thing here, It makes nvim to crash as soon as I edit something. ! But, by removing opts = { ...} in my Lazy plugin setup , it works. even an empty opts = {} make it fail. I am guessing opts is calling a setup.

If I know correctly, removing opts prevents the plugin from starting properly (like calling require(...).setup({}) which is why it works since blink isn't being configured then.

@Saghen
Copy link
Owner

Saghen commented Dec 21, 2024

Duplicate of #68

@Saghen Saghen marked this as a duplicate of #68 Dec 21, 2024
@Saghen Saghen closed this as not planned Won't fix, can't repro, duplicate, stale Dec 21, 2024
@Saghen
Copy link
Owner

Saghen commented Dec 21, 2024

I'm hopeful this won't be an issue for future versions due to some new checksum checks, but I'll re-open that issue if it is

@ZohnyZeyad
Copy link
Author

ZohnyZeyad commented Dec 21, 2024

Duplicate of #68

I have checked the previous issue before submitting this one and the "solutions" mentioned there didn't work either. Especially that the rest of the discussion there was about a different OS (I'm using Ubuntu 24.04 LTS) and a different blink release. I'm not sure if I'm missing something here.

@Saghen Saghen reopened this Dec 21, 2024
@ZohnyZeyad
Copy link
Author

Additional info / tries:

  • Explicitly disabling Lazy.nvim caching:

require("lazy").setup("plugins", { performance = { cache = { enabled = false, } },

  • Even cloning the repo into ~/.local/share/nvim/lazy/blink.cmp and rebuilding from source with cargo build --release

Still doesn't work.

@Saghen
Copy link
Owner

Saghen commented Dec 21, 2024

It seems like you have the same issue as #685 (comment), where vim.treesitter.get_node in your configuration should be in a pcall

@ZohnyZeyad
Copy link
Author

ZohnyZeyad commented Dec 21, 2024

It seems like you have the same issue as #685 (comment), where vim.treesitter.get_node in your configuration should be in a pcall

Wrapping it in pcall seems to resolve the startup issue, but this one related to ctags is still broken for some reason which happens whenever I'm in insert mode:
image

@Saghen
Copy link
Owner

Saghen commented Dec 21, 2024

This might be unrelated to blink since we should report the error differently. Are you able to reproduce the error on old versions (i.e. v0.7.6)?

@albinkc
Copy link

albinkc commented Dec 21, 2024

I'm also getting this error on a fresh install of LazyVim with all configs and locals removed when I run LazyHealth.

blink.cmp healthcheck ~
- OK curl is installed
- OK git is installed
- OK Your system is supported by pre-built binaries (aarch64-apple-darwin)
- ERROR Failed to run healthcheck for "blink.cmp" plugin. Exception:
  ...local/share/nvim/lazy/blink.cmp/lua/blink/cmp/health.lua:27: bad argument #1 to 'fs_stat' (string expected, got nil)

OS: MacOS 15.2

@Saghen
Copy link
Owner

Saghen commented Dec 21, 2024

That error is a red herring, it's fixed on main but it's not causing any issues

@ZohnyZeyad
Copy link
Author

This might be unrelated to blink since we should report the error differently. Are you able to reproduce the error on old versions (i.e. v0.7.6)?

It seems to work just fine with v0.7.6 when editing lua files (I have ctags-lsp.nvim setup to only work on lua files.
The only way to reproduce this issue on v0.7.6 is to change ctags-lsp setup to work with a language that doesn't currently have universal ctags support (ex. Scala). but that's irrelevant since I'm testing for Lua atm.

P.S. I've also posted an issue on ctags-lsp.nvim repo in case they have something to do with it even tho it definitely breaks with the new v0.8 update. But I'll report back on that when I get something from them.

Oh and btw I also get the same error on healthcheck, forgot to mention earlier.

@stopdesign
Copy link

I also experienced this issue (nvim crashing right after completion was initiated) yesterday. The issue disappeared after I uninstalled the plugin, reinstalled it, and gave the computer a good hard hit. I’m glad the old tricks still work with nvim.

@netmute
Copy link

netmute commented Dec 22, 2024

Author of ctags-lsp here. The "Method not found" error was me. I didn't handle the "$/cancelRequest" request, which blink.cmp didn't send before. This is fixed in v0.6.1.

@ZohnyZeyad
Copy link
Author

Author of ctags-lsp here. The "Method not found" error was me. I didn't handle the "$/cancelRequest" request, which blink.cmp didn't send before. This is fixed in v0.6.1.

Seems like everything now is working more or less as expected. Thank you everyone and happy holidays!

@Saghen Saghen closed this as completed Dec 22, 2024
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

No branches or pull requests

9 participants