Skip to content

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

Open
@FabricSoul

Description

@FabricSoul

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions