rcarriga / nvim-notify

A fancy, configurable, notification manager for NeoVim
MIT License
2.97k stars 78 forks source link

attempt to index field 'title' (a number value) #136

Closed Kohirus closed 1 year ago

Kohirus commented 1 year ago

I use mason.nvim to install LSP servers, DAP servers, linters, and formatters. After I started Neovim, then I type :Mason command to open Mason's window, When the installed server package check update was complete, I received the following error message:

Error executing vim.schedule lua callback: ...k/packer/start/nvim-notify/lua/notify/render/default.Lua:9:attempt to index field 'title'(a number value)
stack traceback:
...k/packer/start/nvim-notify/lua/notify/render/default.Lua:9:in function 'render'
...ker/start/nvim-notify/lua/notify/service/buffer/init.Lua:102:in function 'render'
..ack/packer/start/nvim-notify/lua/notify/service/init.Lua:53:in function push'
...m/site/pack/packer/start/nvim-notify/lua/notify/init.Lua:214:in function 'notify'
...m/site/pack/packer/start/nvim-notify/Lua/notify/init.Lua:275:in function <...m/site/pack/packer/start/nvimnotify/lua/notify/init.Lua:274>

The screenshot is as follows:

question1

Then i type Enter to continue:

question2

rcarriga commented 1 year ago

This is likely a bad notification being called with a number title. I've added a validation check so you'll get a strack trace with the location of where it's called now

Kohirus commented 1 year ago

The screenshot is as follows: question3

rcarriga commented 1 year ago

I took a look and your dotfiles define a global error function. This overrides the builtin in error function which is used by a lot of code. Don't do this. In general avoid defining globals unless they have very specific names that are not going to be used by anything else

Kohirus commented 1 year ago

Now the plugin works properly!Thank you!I will close the issue.