adalessa / laravel.nvim

Plugin for Nvim to work with laravel projects.
MIT License
280 stars 15 forks source link

Failed to run config for laravel.nvim - attempt to call method 'executable' (a nil value) #73

Closed Kazuto closed 7 months ago

Kazuto commented 8 months ago

Upon entering a laravel project I now get the following error, though it worked before my vacation:

image

This is my configuration

local laravel = {
    "adalessa/laravel.nvim",
    dependencies = {
        "nvim-telescope/telescope.nvim",
        "tpope/vim-dotenv",
        "MunifTanjim/nui.nvim",
        "nvimtools/none-ls.nvim",
    },
    cmd = { "Sail", "Artisan", "Composer", "Npm", "Yarn", "Laravel" },
    keys = {
        { "<leader>la", ":Laravel artisan<cr>" },
        { "<leader>lr", ":Laravel routes<cr>" },
        { "<leader>lm", ":Laravel related<cr>" },
        {
            "<leader>lt",
            function()
                require("laravel.tinker").send_to_tinker()
            end,
            mode = "v",
            desc = "Laravel Application Routes",
        },
    },
    event = { "VeryLazy" },
    config = function()
        require("laravel").setup() -- Line 251
        require("telescope").load_extension("laravel")
    end,
}

And my .zshrc contains

export NVIM_LARAVEL_ENV=local
adalessa commented 8 months ago

This for sure puzzles me. Since in the code before calling the executable there is a check for nil. Are you still in v1 or have you updated. I assume you have updated since I the lines matches the last version. If you run again after loading require('laravel').setup() does it return the same error ?

If still happen, could you do a vim.print(M.environment) on the file laravel/environment/init.lua on line 63? Tyring to understand what is assigning if is not null but also does not have the expected function.

adalessa commented 7 months ago

Closing it for now due to inactivity. If you think this is still an issue please re-open with details.