Skip to content

TypeError: attempt to index field 'noti' (a number value) #169

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

Open
FabricSoul opened this issue Mar 2, 2025 · 0 comments
Open

TypeError: attempt to index field 'noti' (a number value) #169

FabricSoul opened this issue Mar 2, 2025 · 0 comments

Comments

@FabricSoul
Copy link

Issue Description

When fetching problem lists with LeetCode.nvim in NixVim, the plugin fails with a type error in the spinner module. The error occurs when trying to index a field named 'noti' which is unexpectedly a number instead of the expected table/object type.

Error Message

E5108: Error executing lua: ...lugin-leetcode.nvim/lua/leetcode/logger/spinner/init.lua:76: attempt to index field 'noti' (a number value)

Stack Trace

stack traceback:
        ...lugin-leetcode.nvim/lua/leetcode/logger/spinner/init.lua:76: in function 'set'
        ...lugin-leetcode.nvim/lua/leetcode/logger/spinner/init.lua:117: in function 'stop'
        ...rt/vimplugin-leetcode.nvim/lua/leetcode/api/problems.lua:90: in function 'all'
        ...mplugin-leetcode.nvim/lua/leetcode/cache/problemlist.lua:67: in function 'read'
        ...mplugin-leetcode.nvim/lua/leetcode/cache/problemlist.lua:32: in function 'get'
        ...rt/vimplugin-leetcode.nvim/lua/leetcode/command/init.lua:28: in function <...rt/vimplugin-leetcode.nvim/lua/leetcode/command/init.lua:25>

Environment

  • Using NixVim
  • LeetCode.nvim version: rev = "db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951"
  • Plenary.nvim version: v0.1.4

Configuration

require("leetcode").setup({
  lang = "rust",
  branch = "dev",
  storage = {
    home = vim.fn.stdpath("data") .. "/leetcode",
    cache = vim.fn.stdpath("cache") .. "/leetcode",
  },
  plugins = {
    non_standalone = true,
  }
})

Reproduction Steps

  1. Set up NixVim with LeetCode.nvim plugin as configured above
  2. Attempt to fetch the problem list in Neovim
  3. Error occurs during the fetch operation

Possible Cause

There appears to be a type mismatch in the spinner module where the code is trying to access a table property ('noti') but is encountering a number value instead. This could be due to:

  1. A version compatibility issue between the plugin and dependencies
  2. NixVim-specific environment differences
  3. A bug in the notification/spinner handling logic of the plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant