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

Debug adapter disconnected #48

Open
letmorfin opened this issue Jun 27, 2023 · 4 comments
Open

Debug adapter disconnected #48

letmorfin opened this issue Jun 27, 2023 · 4 comments

Comments

@letmorfin
Copy link

letmorfin commented Jun 27, 2023

When I try to run this command :lua require'dap'.continue() with the config below I get a message: "Debug adapter disconnected"
my js-dap.lua file

require("dap-vscode-js").setup({
	-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
	-- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation.
	--debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.
	adapters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" }, -- which adapters to register in nvim-dap
	-- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging
	-- log_file_level = false -- Logging level for output to file. Set to false to disable file logging.
	-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
})
for _, language in ipairs({ "typescript", "javascript" }) do
	require("dap").configurations[language] = {
		{
			type = "pwa-node",
			request = "launch",
			name = "Launch file",
			program = "${file}",
			cwd = "${workspaceFolder}",
		},
	}
end

my packer.lua:

	use({ "mxsdev/nvim-dap-vscode-js", requires = { "mfussenegger/nvim-dap" } })
	use({
		"microsoft/vscode-js-debug",
		opt = true,
		run = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out",
	})
	use("rcarriga/nvim-dap-ui")

i also downloaded js-debug-adapter using Mason but it didn't help

@prajwal-unext
Copy link

Facing this same issue. Any update on this ?

@foxt451
Copy link

foxt451 commented Nov 11, 2023

Same. It just doesn't work for ts

@AntonyZ89
Copy link

AntonyZ89 commented Nov 20, 2023

If you are using "ts-node-dev" to build your project replace "node" by "ts-node-dev" on runtimeExecutable

If you are using "ts-node" try the first config:

image

Or just use Auto Attach (ref: #62):

image

Remember to add --inspect on dev command

tsnd --inspect -r dotenv/config -r tsconfig-paths/register ./src/main.ts

Here my nvim config

@IgberZBN
Copy link

Can u debug using Bun project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants