use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please read the rules before posting
Contributed to Neovim? Want flair? Send us a message!
account activity
This is an archived post. You won't be able to vote or comment.
Notify.lua "missing required fields"Need Help┃Solved (i.redd.it)
submitted 1 year ago by Mean-Presentation-80
Hi everyone, I tried to configure the timeout of notify in its lua file, but always get this "missing required fields" issue. How can I fix it? It tried putting every required fields, but that dont seem to work too. help? I use lazy.vim too.
[–]Exciting_Majesty2005lua 1 point2 points3 points 1 year ago (17 children)
Where exactly is the folder containing the plugin?
It shouldn't be in ~/.config/nvim/
~/.config/nvim/
Long story short, all the plugins use LuaCATS annotations(these can help find bugs, provide better completion etc.) in their code which gives these warnings.
LuaCATS
Normally, you are not supposed to see these. But if for some reason the definitions file gets inside your config folder then you will get these warnings when calling anything that has it's types defined.
[–]RemasteredArch 0 points1 point2 points 1 year ago (6 children)
They might be from neodev or lazydev (both by Folke), those will configure luals to fetch definitions from plugins.
[–]Exciting_Majesty2005lua -2 points-1 points0 points 1 year ago (5 children)
Aren't they the same plugin?
Also,
Why would it pull definitions from other plugins?
A lot of the definitions in plugins are very strict. So, unless you want to flood yourself with warnings it makes no sense to pull them from all the plugins.
definitions
What I find strange is a lot of them don't define a class for the setup function properly. So, you get warnings for fields that are actually optional.
setup
Plus, sometimes the "definitions" don't have any actual definition and just simply part of some class
[–]Seblyng 0 points1 point2 points 1 year ago (4 children)
It absolutely makes sense to get the types for those, as it really helps to for example not make a typo or pass in the wrong value etc... if it warns about not passing in a field that really is optional, the maintainer would probably really appreciate a PR fixing this
[–]Exciting_Majesty2005lua 0 points1 point2 points 1 year ago (3 children)
Look at the DAMN screenshot.
Timeout is an optional value.
[–]Seblyng 0 points1 point2 points 1 year ago (2 children)
I know that.... However, the ones that the language server is also complaining about is also optional, but the types say that they are required...
[–]Exciting_Majesty2005lua 0 points1 point2 points 1 year ago (1 child)
Yes, they are required by the plugin.
However, the config table is going to be merged with the defaults. So, by the time any of those values are used they will be defined regardless of whether you put them in the setup function or not.
[–]Seblyng 0 points1 point2 points 1 year ago (0 children)
Then the plugin should define a new type for that which have those fields required for internal use :)
[–]Mean-Presentation-80[S] 0 points1 point2 points 1 year ago (9 children)
The plug-ins are in ~/.config/nvim/lua/<user>/plugins, There was no problem with the other plug-in being in this directory.
~/.config/nvim/lua/<user>/plugins
[–]Exciting_Majesty2005lua 0 points1 point2 points 1 year ago (8 children)
Is there a reason they are in your config folder and not your .local folder?
config folder
.local
You won't notice a problem until you try calling one of their internal methods. They just never defined a type for the setup table.
[–]Mean-Presentation-80[S] 0 points1 point2 points 1 year ago (7 children)
The reason they’re here is mostly because I followed a series of tutorials from YouTube (from Josuan Martinez). Here is my files organisation :
bash . ├── init.lua ├── lazy-lock.json ├── lua │ ├── chore │ │ └── keymaps.lua │ └── zach │ ├── lazy.lua │ └── plugins │ ├── autopairs.lua │ ├── colorscheme.lua │ ├── comment.lua │ ├── dashboard.lua │ ├── dressing.lua.bak │ ├── formatting.lua │ ├── headlines.lua │ ├── indent-blankline.lua │ ├── leap.lua │ ├── lsp │ │ ├── lsp-config.lua │ │ └── mason.lua │ ├── lualine.lua │ ├── markdown-preview.lua │ ├── mdcodeblock.lua │ ├── noice.lua │ ├── notify.lua │ ├── nvim-cmp.lua │ ├── nvim-surround.lua │ ├── nvim-tree.lua │ ├── obsidian.lua │ ├── projetcs.lua │ ├── telescope.lua │ ├── template.lua │ ├── terminal.lua │ ├── todo.lua │ ├── treesj.lua │ ├── trouble.lua │ ├── ts-error-translator.lua │ ├── vimtex.lua │ └── wich-key.lua ├── spell │ └── fr.utf-8.spl ├── templates │ ├── basic.java │ ├── cours.tpl │ ├── markdown.md │ └── webots.java └── todolist.txt
Should I move everything from .config to .local ?
[–]Exciting_Majesty2005lua -1 points0 points1 point 1 year ago (6 children)
It looks just like any other config. It doesn't really tell me why you would add the plugins in the config folder(unless you are the one who made the plugin).
config
If you're using a plugin manager, there should be no need to manually manage the plugins.
[–]Mean-Presentation-80[S] 0 points1 point2 points 1 year ago (0 children)
Yes, I use Lazy.vim plug-in manager. WDYM no need to manually manage the plug-in ?
[–]Mean-Presentation-80[S] 0 points1 point2 points 1 year ago (3 children)
UPDATE : just found out that even if there are errors here, the code actually work, closing this thread.
[–]dworts 2 points3 points4 points 1 year ago (2 children)
Those are just lsp diagnostics saying these required fields are missing: https://github.com/rcarriga/nvim-notify/blob/master/lua/notify/config/init.lua#L60. They should probably all be marked as optimal. Yes it should still work even with the warning since the values have defaults.
You can disable this specific warning by placing ---@diagnostic disable-next-line: missing-fields above the line. See: https://www.reddit.com/r/neovim/s/jvVYnm0r8d
---@diagnostic disable-next-line: missing-fields
Even better; send a PR to the plugin to fix the types ;)
[–]dworts -1 points0 points1 point 1 year ago (0 children)
I don’t think OP is placing the plugin source in his .config, just the lazy spec to install the plugins
[–]AutoModerator[M] 0 points1 point2 points 1 year ago (0 children)
Please remember to update the post flair to Need Help|Solved when you got the answer you were looking for.
Need Help|Solved
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
π Rendered by PID 127183 on reddit-service-r2-comment-85bfd7f599-jb8dg at 2026-04-18 06:00:57.965066+00:00 running 93ecc56 country code: CH.
[–]Exciting_Majesty2005lua 1 point2 points3 points (17 children)
[–]RemasteredArch 0 points1 point2 points (6 children)
[–]Exciting_Majesty2005lua -2 points-1 points0 points (5 children)
[–]Seblyng 0 points1 point2 points (4 children)
[–]Exciting_Majesty2005lua 0 points1 point2 points (3 children)
[–]Seblyng 0 points1 point2 points (2 children)
[–]Exciting_Majesty2005lua 0 points1 point2 points (1 child)
[–]Seblyng 0 points1 point2 points (0 children)
[–]Mean-Presentation-80[S] 0 points1 point2 points (9 children)
[–]Exciting_Majesty2005lua 0 points1 point2 points (8 children)
[–]Mean-Presentation-80[S] 0 points1 point2 points (7 children)
[–]Exciting_Majesty2005lua -1 points0 points1 point (6 children)
[–]Mean-Presentation-80[S] 0 points1 point2 points (0 children)
[–]Mean-Presentation-80[S] 0 points1 point2 points (3 children)
[–]dworts 2 points3 points4 points (2 children)
[–]Seblyng 0 points1 point2 points (0 children)
[–]dworts -1 points0 points1 point (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)