Skip to content

Error: attempt to index a nil value #15

@Integralist

Description

@Integralist

👋🏻 I stumbled into this error...

Error executing vim.schedule lua callback: .../lazy/jsonfly.nvim/lua/telescope/_extensions/jsonfly.lua:209: attempt to index a nil value
stack traceback:
        .../lazy/jsonfly.nvim/lua/telescope/_extensions/jsonfly.lua:209: in function 'handler'
        .../Cellar/neovim/0.10.0/share/nvim/runtime/lua/vim/lsp.lua:923: in function 'handler'
        .../neovim/0.10.0/share/nvim/runtime/lua/vim/lsp/client.lua:685: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

From what I can tell if I open nvim with the following file and trigger the :Telescope jsonfly then I'll see the above error:

{
  "foo": true,
  "bar": 0,
  "baz": "example",
  "qux": [
    "a"
  ],
  "qiz": [],
  "ziz": {}
}

The problem at first looked to be the last two fields qiz and ziz.

But even if I remove those fields and restart nvim, then the error will persist.

Interestingly, it's the qux field that's the problem, even though it has a value in its array: ["a"]?

The following will parse fine...

{
  "foo": true,
  "bar": 0,
  "baz": "example",
  "qiz": [],
  "ziz": {}
}

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