goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.84k stars 109 forks source link

alpha.setup {} or alpha.setup() trigger error : no file in main chunk #98

Closed stephaneeybert closed 2 years ago

stephaneeybert commented 2 years ago

I have an init.lua file that contains: require "user.setup.alpha"

And the alpha.lua file is:

 local status_ok, alpha = pcall(require, "alpha")    
 if not status_ok then                                        
   return    
 end    

 alpha.setup {                                                       
 }

But when I type in the :source command it shows an error message.

I could not copy paste the error message. So i wrote it roughly down here:

Error executing lua [string ": source (no file) ]: 6 loop or previous error loading module 'user.setup.alpha'
stack:
  in function 'require'
  in main chunk

The error is on the line: alpha.setup {}

I also tried having this line instead: alpha.setup()

But the error remained the same.

The plugin is installed with: use "goolord/alpha-nvim"

I also tried with the following plugin:

use {
   "goolord/alpha-nvim",
   config = function()
      require("config.alpha").setup()
   end,
}

And that gave me the error: module 'config.alpha' not found

I'm on NVIM v0.6.1

goolord commented 2 years ago

i'm not sure what the module 'config.alpha' not found error is about, that sounds like a problem with your personal config. but, you can't call setup without passing a layout, just paste one of https://github.com/goolord/alpha-nvim#quick-start

goolord commented 2 years ago

additionally, your config.alpha module doesn't return a table with a setup key, so require("config.alpha").setup() will also not work. I'm happy to help with neovim configs when I can, but the issue tracker isn't the appropriate place for these kinds of questions

stephaneeybert commented 2 years ago

Sorry for posting my issue here. I shall post on SO then. I just tried the example configuration seen on the README here.