Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks done
nickali opened this issue Aug 6, 2024 · 6 comments
Open
4 tasks done

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

nickali opened this issue Aug 6, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@nickali
Copy link

nickali commented Aug 6, 2024

Checklist

  • I have searched through the AstroNvim documentation
  • I have searched through the existing issues of this project
  • I have searched the existing issues of plugins related to this issue
  • I can replicate the bug with the minimal repro.lua provided below

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.)
@nickali nickali added the bug Something isn't working label Aug 6, 2024
@Uzaaft
Copy link
Member

Uzaaft commented Aug 7, 2024

@nickali Please provide a repro.lua

@Uzaaft Uzaaft added the question Further information is requested label Aug 7, 2024
@nickali
Copy link
Author

nickali commented Aug 7, 2024

@Uzaaft, I updated the minimal configuration above.

@Uzaaft
Copy link
Member

Uzaaft commented Aug 7, 2024

Appreciate it :)

@Uzaaft Uzaaft removed the question Further information is requested label Aug 7, 2024
@art1es23
Copy link

art1es23 commented Sep 1, 2024

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
Copy link
Author

nickali commented Sep 2, 2024

@nickali did you find how fix it?

No.

@mnchaser
Copy link

Same issue here, every time I open an MDX file I get that error. I noticed the error message says:

...Can't find typescript.js or tsserverlibrary.js in \"......(my project root folder) /node_modules/node_modules/typescript/lib\"

Which appears to be one too many node_modules directories. But I can't figure out which LSP client/plugin/config where this path is being set...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants