vuki656 / package-info.nvim

✍️ All the npm/yarn/pnpm commands I don't want to type
GNU General Public License v3.0
487 stars 28 forks source link

[BUG] Errors on every load #160

Open KorigamiK opened 3 months ago

KorigamiK commented 3 months ago

Issues

Plugin Version

Neovim Version

Neovim Version

v0.10.1

Branch

master

Actual behavior

It produces duplicate text and errors the following:

image

input table: 0x7e1f54e2ad80 ...lazy/package-info.nvim/lua/package-info/virtual_text.lua:49: attempt to concatenate field 'version' (a nil value)                                               
stack traceback:                                                                                                                                                                               
^I...lazy/package-info.nvim/lua/package-info/virtual_text.lua:49: in function '__display_on_line'                                                                                              
^I...lazy/package-info.nvim/lua/package-info/virtual_text.lua:82: in function 'display'                                                                                                        
^I...lazy/package-info.nvim/lua/package-info/actions/show.lua:44: in function 'on_success'                                                                                                     
^I...im/lazy/package-info.nvim/lua/package-info/utils/job.lua:52: in function <...im/lazy/package-info.nvim/lua/package-info/utils/job.lua:41>                                                 
^I[C]: at 0x5941d8c58200                                                                                                                                                                       
^I[C]: in function 'pcall'                                                                                                                                                                     
^I/usr/share/nvim/runtime/lua/vim/ui.lua:101: in function 'input'                                                                                                                              
^I...ocal/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/lib.lua:238: in function 'prompt'                                                                                                        
^I...y/nvim-tree.lua/lua/nvim-tree/actions/fs/remove-file.lua:133: in function <...y/nvim-tree.lua/lua/nvim-tree/actions/fs/remove-file.lua:107>                                               
[NvimTree] /home/origami/Dev/projects/team/mindsurf/apps/website/.wrangler was properly removed.                                                                                               
[NvimTree] /home/origami/Dev/projects/team/mindsurf/apps/website/migrations was properly removed.                                                                                              
...lazy/package-info.nvim/lua/package-info/virtual_text.lua:49: attempt to concatenate field 'version' (a nil value)                                                                           
stack traceback:                                                                                                                                                                               
^I...lazy/package-info.nvim/lua/package-info/virtual_text.lua:49: in function '__display_on_line'                                                                                              
^I...lazy/package-info.nvim/lua/package-info/virtual_text.lua:82: in function 'display'                                                                                                        
^I...lazy/package-info.nvim/lua/package-info/actions/show.lua:44: in function 'on_success'                                                                                                     
^I...im/lazy/package-info.nvim/lua/package-info/utils/job.lua:52: in function <...im/lazy/package-info.nvim/lua/package-info/utils/job.lua:41> function: builtin#18 ...lazy/package-info.nvim/l
ua/package-info/virtual_text.lua:49: attempt to concatenate field 'version' (a nil value)                                                                                                      
stack traceback:                                                                                                                                                                               
^I...lazy/package-info.nvim/lua/package-info/virtual_text.lua:49: in function '__display_on_line'       

Expected behavior

No errors

Steps to reproduce

Open package.json then move to another buffer, reopen package.json

Package info config

I am using lazy.nvim with the following config:

  {
    "vuki656/package-info.nvim",
    event = "BufRead package.json",
    dependencies = { "MunifTanjim/nui.nvim" },
    config = true,
  },

Other information

No response

Help

Yes, but I don't know how to start. I would need guidance (check question below)

Implementation help

No response

vuki656 commented 3 months ago

Hey, is this something that started happening recently or did you just install the plugin fresh?

If it's a fresh install, try removing event = "BufRead package.json",. That looks like something that might be the culprit

KorigamiK commented 3 months ago

Hey, is this something that started happening recently or did you just install the plugin fresh?

If it's a fresh install, try removing event = "BufRead package.json",. That looks like something that might be the culprit

Hey, sorry for the late response (GitHub notifications are a mess). But I've noticed this error happening after the recent updates. Although I did face some errors occasionally before that as well.

If I remove the event from the config, I still get the error when I try to move to another file named package.json which is different from the one I just opened. This is the error I get then:

E5108: Error executing lua: .../.local/share/nvim/lazy/ui/lua/nvchad/tabufline/init.lua:23: BufEnter Autocommands for "package.json": Vim(lua):E5108: Error executing lua ...lazy/package-inf
o.nvim/lua/package-info/virtual_text.lua:49: attempt to concatenate field 'version' (a nil value)                                                                                            
stack traceback:                                                                                                                                                                             
        ...lazy/package-info.nvim/lua/package-info/virtual_text.lua:49: in function '__display_on_line'                                                                                      
        ...lazy/package-info.nvim/lua/package-info/virtual_text.lua:82: in function 'display'                                                                                                
        ...zy/package-info.nvim/lua/package-info/helpers/reload.lua:29: in function 'reload'                                                                                                 
        ...lazy/package-info.nvim/lua/package-info/actions/show.lua:18: in function 'run'                                                                                                    
        ...re/nvim/lazy/package-info.nvim/lua/package-info/init.lua:14: in function 'show'                                                                                                   
        [string ":lua"]:1: in main chunk                                                                                                                                                     
        [C]: in function 'set_buf'                                                                                                                                                           
        .../.local/share/nvim/lazy/ui/lua/nvchad/tabufline/init.lua:23: in function 'next'                                                                                                   
        /home/origami/.config/nvim/lua/mappings.lua:56: in function </home/origami/.config/nvim/lua/mappings.lua:55>                                                                         
stack traceback:                                                                                                                                                                             
        [C]: in function 'set_buf'                                                                                                                                                           
        .../.local/share/nvim/lazy/ui/lua/nvchad/tabufline/init.lua:23: in function 'next'                                                                                                   
        /home/origami/.config/nvim/lua/mappings.lua:56: in function </home/origami/.config/nvim/lua/mappings.lua:55>