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

node: add configuration snippets missing #286

Open
8Observer8 opened this issue Dec 23, 2024 · 4 comments
Open

node: add configuration snippets missing #286

8Observer8 opened this issue Dec 23, 2024 · 4 comments

Comments

@8Observer8
Copy link

8Observer8 commented Dec 23, 2024

I try to make the same steps for Node.js like for Python:

image

Traceback (most recent call last):
  File "E:\Program Files\Sublime Text\Lib\python38\sublime_plugin.py", line 1218, in preview_
    ret = self.preview(v)
  File "C:\Users\8Observer8\AppData\Roaming\Sublime Text\Packages\Debugger\modules\ui\input.py", line 145, in preview
    if preview := self.values[arg].preview:
TypeError: list indices must be integers or slices, not str
  • Sublime Text 4189
  • Windows 10, 64-bit
  • Node.js 22.12.0
  • Python 3.12.7
@daveleroy
Copy link
Owner

You can add your own configuration see https://code.visualstudio.com/docs/nodejs/nodejs-debugging

@8Observer8
Copy link
Author

@daveleroy, please, help me. I try to use this configuration: Launch configuration support for 'npm' and other tools

What should I try to change here?

{
	"folders":
	[
		{
			"path": ".",
		}
	],
	"debugger_configurations":
	[
		{
		  "name": "Launch via npm",
		  "type": "node",
		  "request": "launch",
		  "cwd": "${workspaceFolder}",
		  "runtimeExecutable": "npm",
		  "runtimeArgs": ["run-script", "debug"]
		}
	],
}

Output:

"C:\Program Files\nodejs\npm.cmd" run-script debug
Could not read source map for file:///C:/Program%20Files/nodejs/node_modules/npm/node_modules/walk-up-path/dist/cjs/index.js: ENOENT: no such file or directory, open 'c:\Program Files\nodejs\node_modules\npm\node_modules\walk-up-path\dist\cjs\index.js.map'
Could not read source map for file:///C:/Program%20Files/nodejs/node_modules/npm/node_modules/which/node_modules/isexe/dist/cjs/index.js: ENOENT: no such file or directory, open 'c:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\dist\cjs\index.js.map'
Could not read source map for file:///C:/Program%20Files/nodejs/node_modules/npm/node_modules/which/node_modules/isexe/dist/cjs/posix.js: ENOENT: no such file or directory, open 'c:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\dist\cjs\posix.js.map'
Could not read source map for file:///C:/Program%20Files/nodejs/node_modules/npm/node_modules/which/node_modules/isexe/dist/cjs/win32.js: ENOENT: no such file or directory, open 'c:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\dist\cjs\win32.js.map'
Could not read source map for file:///C:/Program%20Files/nodejs/node_modules/npm/node_modules/which/node_modules/isexe/dist/cjs/options.js: ENOENT: no such file or directory, open 'c:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\dist\cjs\options.js.map'
Could not read source map for file:///C:/Program%20Files/nodejs/node_modules/npm/node_modules/minipass/dist/commonjs/index.js: ENOENT: no such file or directory, open 'c:\Program Files\nodejs\node_modules\npm\node_modules\minipass\dist\commonjs\index.js.map'
Process exited with code 1
Debugging ended

image

@8Observer8
Copy link
Author

This configuration works: Multi version support

{
	"folders":
	[
		{
			"path": ".",
		}
	],
	"debugger_configurations":
	[
		{
		  "type": "node",
		  "request": "launch",
		  "name": "Launch test",
		  "runtimeVersion": "14",
		  "program": "${workspaceFolder}/index.js"
		}
	],
}

Start debugging:
image
Finish debugging:
image

@8Observer8
Copy link
Author

8Observer8 commented Dec 23, 2024

@daveleroy, could you add the same way to add a configuration file like for the C language and for Python:

image

But for Node.js there is nothing here:

image

It will be nice if the default configuration file will be created like this:

{
	"folders":
	[
		{
			"path": ".",
		}
	],
	"debugger_configurations":
	[
		{
		  "type": "node",
		  "request": "launch",
		  "name": "Launch test",
		  "runtimeVersion": "14",
		  "program": "${workspaceFolder}/index.js"
		}
	],
}

If you don't plan it you can close this issue.

@daveleroy daveleroy changed the title Node.js debugging: list indices must be integers or slices, not str node: add configuration snippets missing Jan 13, 2025
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

2 participants