auto-session icon indicating copy to clipboard operation
auto-session copied to clipboard

[BUG] checkhealth reports attempt to call field 'debug' and plugin doesn’t work

Open strogonoff opened this issue 10 months ago • 5 comments

Describe the bug Healthcheck fails due to the plugin and the plugin does not work.

To Reproduce Install with vim-plug on Neovim 0.11.0 and run :checkhealth

Expected behavior Successful healthcheck.

Checkhealth

auto-session:                           require("auto-session.health").check()

vim options ~
- OK vim.o.sessionoptions

Lazy.nvim settings ~
- Lazy.nvim not loaded

Config ~
- OK {}

General Info ~
- ERROR Failed to run healthcheck for "auto-session" plugin. Exception:
  ...hare/nvim/plugged/auto-session/lua/auto-session/init.lua:318: attempt to call field 'debug' (a nil value)

Baseline (please complete the following information):

  • Result of set sessionoptions?: sessionoptions=blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions
  • OS. e.g uname -a: Darwin arm64
  • Neovim version nvim --version 0.11.0
  • URL to your current config (if public)

Additional context

strogonoff avatar Jun 08 '25 09:06 strogonoff

I'm not too familiar with vim-plug but the issue is happening because setup is not being called. You can call setup with something like:

call plug#begin()
Plug 'rmagatti/auto-session'
call plug#end()

" add any configuration here
lua require('auto-session').setup({})

I'll add a note to the readme about making sure setup is called.

cameronr avatar Jun 08 '25 16:06 cameronr

Yup, that does it. Thank you!

Strangely, I think on an older installation my config did not have the setup line and worked, so it was confusing for a moment because other than plugin version everything was the same. Who knows…

strogonoff avatar Jun 09 '25 07:06 strogonoff

Based on the code history, I think some versions from a few years ago that did some initialization in vimscript and may not have needed the setup call so maybe that was it?

Either way, glad it's working now!

cameronr avatar Jun 09 '25 15:06 cameronr

Can close it I guess, but doc changes definitely make sense. Do you want keep it open until doc changes are merged in?

strogonoff avatar Jun 09 '25 15:06 strogonoff

Yeah, let's keep it open until the doc/checkhealth changes are merged.

cameronr avatar Jun 09 '25 19:06 cameronr