AstroNvim / astrocommunity

A community repository of common plugin specifications
GNU General Public License v3.0
1.13k stars 232 forks source link

MDX Error: Can't find typescript.js or tsserverlibrary.js #1144

Open nickali opened 1 month ago

nickali commented 1 month ago

Checklist

Neovim version (nvim -v)

v0.10.1

Operating system/version

macOS 14.5

Terminal/GUI

Alacritty

Describe the bug

I get the following error at the bottom whenever I open a MDX file:

Error executing vim.schedule lua callback: .../neovim/0.10.1/share/nvim/runtime/lua/vim/lsp/client.lua:588: RPC[Error] code_name = InternalError, message = "Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in \"\""
stack traceback:
        [C]: in function 'assert'
        .../neovim/0.10.1/share/nvim/runtime/lua/vim/lsp/client.lua:588: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

If I escape out of it, everything seems to work fine.

If I do :Mason, I see marksman and mdx-analyzer installed.

Steps to Reproduce

Opening any file with the MDX extension, even if it is empty.

Expected behavior

No error displayed.

Screenshots

No response

Additional Context

No response

Minimal configuration

-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
    vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    -- stylua: ignore
    vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable",
        lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

-- install plugins
local plugins = {
    { "AstroNvim/AstroNvim",      import = "astronvim.plugins" },
    { "AstroNvim/astrocommunity", import = "astrocommunity.pack.mdx" },
    -- add any other plugins/customizations here
}
require("lazy").setup(plugins, {
    root = root .. "/plugins",
})

-- add anything else here (autocommands, vim.filetype, etc.)
Uzaaft commented 1 month ago

@nickali Please provide a repro.lua

nickali commented 1 month ago

@Uzaaft, I updated the minimal configuration above.

Uzaaft commented 1 month ago

Appreciate it :)

art1es23 commented 1 week ago

The same issue with 'tsserver' in Vue files if project doesn't exist TS


Error executing vim.schedule lua callback: .../neovim/0.10.1/share/nvim/runtime/lua/vim/lsp/client.lua:588: RPC[Error] code_name = InternalError, message = "Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in \"/Users/qmpwwsd/Desktop/smartgroups/smartchat-ui/node_modules/typescript/lib\""
stack traceback:
    [C]: in function 'assert'
    .../neovim/0.10.1/share/nvim/runtime/lua/vim/lsp/client.lua:588: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

@nickali did you find how fix it?

nickali commented 1 week ago

@nickali did you find how fix it?

No.