nvimtools / none-ls.nvim

null-ls.nvim reloaded / Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
The Unlicense
2.43k stars 72 forks source link

Getting failed to load builtin eslint_d for method diagnostics; please check your config #85

Closed itsramiel closed 6 months ago

itsramiel commented 6 months ago

FAQ

Issues

Neovim Version

0.9.5

Dev Version?

Operating System

Macos Sonoma 14.3.1

Minimal Config

Only this line was added ->> null_ls.builtins.diagnostics.eslint_d

-- this template is borrowed from nvim-lspconfig
local on_windows = vim.loop.os_uname().version:match("Windows")

local function join_paths(...)
  local path_sep = on_windows and "\\" or "/"
  local result = table.concat({ ... }, path_sep)
  return result
end

vim.g.loaded_remote_plugins = ""
vim.cmd([[set runtimepath=$VIMRUNTIME]])

local temp_dir = vim.loop.os_getenv("TEMP") or "/tmp"

vim.cmd("set packpath=" .. join_paths(temp_dir, "nvim", "site"))

local package_root = join_paths(temp_dir, "nvim", "site", "pack")
local install_path = join_paths(package_root, "packer", "start", "packer.nvim")
local compile_path = join_paths(install_path, "plugin", "packer_compiled.lua")

local null_ls_config = function()
  local null_ls = require("null-ls")
  -- add only what you need to reproduce your issue
  null_ls.setup({
    sources = {
      null_ls.builtins.diagnostics.eslint_d
    },
    debug = true,
  })
end

local function load_plugins()
  -- only add other plugins if they are necessary to reproduce the issue
  require("packer").startup({
    {
      "wbthomason/packer.nvim",
      {
        "nvimtools/none-ls.nvim",
        requires = { "nvim-lua/plenary.nvim" },
        config = null_ls_config,
      },
    },
    config = {
      package_root = package_root,
      compile_path = compile_path,
    },
  })
end

if vim.fn.isdirectory(install_path) == 0 then
  vim.fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
  load_plugins()
  require("packer").sync()
else
  load_plugins()
  require("packer").sync()
end


### Steps to Reproduce

- Simply add the `eslint_d` diagnostics in the sources and you will egt the following error:
`failed to load builtin eslint_d for method diagnostics; please check your config`

- Make sure you install eslint_d using `npm install -g eslint_d` or using mason-null-ls

Note: If I use `jose-elias-alvarez/null-ls.nvim` instead then everything works fine, so I am guessing this is a bug

### Reproducibility Check

- [ ] I confirm that my minimal config is based on the `minimal_init.lua` template and that my issue is reproducible by running `nvim --clean -u minimal_init.lua` and following the steps above.

### Expected Behavior

I expect the `eslint_d` diagnostic to be recognized as it does when using `jose-elias-alvarez/null-ls.nvim` 

### Actual Behavior

I get the following error: `failed to load builtin eslint_d for method diagnostics; please check your config`

### Debug Log

[WARN  Fri Mar  1 18:30:41 2024] /Users/itsramiel/.local/share/nvim/lazy/none-ls.nvim/lua/null-ls/builtins/init.lua:17: failed to load builtin eslint_d for method diagnostics; please check your config

### Help

Yes, but I don't know how to start. I would need guidance

### Implementation Help

_No response_

### Requirements

- [X] I have read and followed the instructions above and understand that my issue will be closed if I did not provide the required information.
mochaaP commented 6 months ago

dup of #81