vscode debugger encounter problem :Cannot find module 'webpack-command', i've installed webpack-cli global, here is my config
{
"type": "node",
"request": "launch",
"name": "node",
"program": "${workspaceFolder}/node_modules/webpack/bin/webpack.js",
"args": ["--config", "./build/dev-server"]
},
I just encountered this error too. I was able to solve it with:
npm install --save-dev webpack-command
Related
I installed Flutter and I have a project that used it (Flutter Web).
As IDE I use VsCode.
When I run the app using command line (flutter run --no-sound-null-safety) it works well, instead when I use VsCode I get this error:
ChromeProxyService: Failed to evaluate expression 'Future': InternalError: No frame with index 17.
ChromeProxyService: Failed to evaluate expression 'that': InternalError: No frame with index 17.
...
I launch the app with fn+f5 and I created this .vscode/launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "Web nosound null",
"type": "dart",
"request": "launch",
"deviceId": "chrome",
"args": [
"--no-sound-null-safety"
]
},
{
"name": "Web sound null",
"type": "dart",
"request": "launch",
"deviceId": "chrome",
"args": []
},
]
}
I tried also flutter clean but nothing changes, also uninstall and reinstall Flutter seems not to solve the problem.
VsCode is updated.
What am I wrong?
There are two types of configurations in vscode debugging,
Launch via NPM and Launch via npm
I tried but didn't find the docs anywhere
What's the difference between those?
// #launch via NPM
{
"type": "node",
"request": "launch",
"name": "Launch via NPM",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"debug"
],
"port": 9229,
"skipFiles": [
"<node_internals>/**"
]
},
// #launch via npm
{
"name": "Launch via NPM",
"request": "launch",
"runtimeArgs": [
"run-script",
"debug"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
}
I get an answer from vscode dev: https://github.com/microsoft/vscode/issues/127232
There is no real difference: the launch config with the "port" attribute is contributed by the legacy node.js debugger and will disappear soon. The second launch config is more recent and comes from js-debug.
Since the legacy debug configurations are automatically redirected to js-debug and since port 9229 is the default debug port anyway, there should be no differences.
I am trying to debug Deno using VSCode on Ubuntu 20.04 LTS running inside WSL-2. I setup my launch.json as described in the Deno manual:
{
"version": "0.2.0",
"configurations": [
{
"name": "Deno",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": ["run", "--inspect-brk", "-A", "${fileBasename}"],
"outputCapture": "std",
"port": 9229
}
]
}
however when I launch Deno the "--inspect-brk" option is being stripped out from the command used to launch Deno. If I modify my launch.json to change the option to "inspect-brk" (removing the leading --) the option shows up on the command line and I get the error:
Cannot resolve module "file:///mnt/c/Users/mlwp/projects/deno/inspect-brk"
Similarly if I change the name of the option to be "--inspect-brk-fun" then I get the message:
Found argument '--inspect-brk-fun' which wasn't expected, or isn't valid in this context
Anyone know why VSCode would strip the option or how to debug this
The cause of your issue was an incompatibility with --inspect-brk in previous versions of the VSCode JavaScript debugger. It has been fixed some time ago and so have the Deno docs on this matter, where the value of type has changed and port has been replaced with attachSimplePort in launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Deno",
"type": "pwa-node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": ["run", "--inspect-brk", "-A", "${file}"],
"attachSimplePort": 9229
}
]
}
However, I've found that using your current configuration should also work on newer releases (1.47+) of VSCode (running on Ubuntu 20.04 in WSL 2).
I have the following launch task in launch.json:
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/MyProject.dll",
[...]
I would also like to run npm run start:dev, when launching, and terminate it when stopping. So I added this:
{
"command": "npm run start:dev",
"name": "Run npm start:dev",
"request": "launch",
"type": "node-terminal",
"cwd": "${workspaceFolder}/ClientApp",
}
But the latter doesn't do anything. Is it possible to run npm run start:dev upon launch together with an MVC Core app?
For testing my visual studio code extension I need to open a specific folder.
I've inserted the folder path into the args property of Launch Test Configuration as explained here:
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["${workspaceRoot}/../../RIOT", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
"preLaunchTask": "npm: watch"
}
This works fine if I manually open VS Code and start the test with Debug: Start (F5).
But I want to run tests in batch mode with npm test and this does not work.
How to configure the folder under test when using npm test?
Set the folder under test with CODE_TESTS_WORKSPACE environment variable:
> export CODE_TESTS_WORKSPACE=whatever_folder
> npm test