I am trying to get breakpoints to hit in Jest Debug for VS Code.
This launch config runs but does not hit breakpoints:
{
"type": "node",
"request": "launch",
"name": "Test",
"runtimeExecutable": "npm",
"runtimeArgs": ["test"],
"port": 9229
}
This launch config does not run, but it looks like it hits breakpoints.
It opens fs.js at a debugger breakpoint with this error:
Error: ENOENT: no such file or directory, access 'node_modules/jest-cli/bin/package.json'
Like it's looking for the workspace's package.json file inside the jest bin directory.
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
For me the solution was that inside VSCodes Debugging Panel inside the Breakpoints section, I had All Exceptions checked. Unchecking this allowed the debugger to work as I expected.
Also the issue did not happen when checking the Uncaught Exceptions Breakpoint handler. All Exceptions actually catches all not just inside your but also inside others code, regardless if they are handled or not.
I had a package.json file one directory up. I deleted it, but still got the same error. I fixed it by copying it to a new directory further up on my path, I believe so VS Code could detect it was a new workspace.
I'm trying to debug express (node) app on my machine, but debug does not start with no indication what so ever.
This happens on code I'm able to debug on another machine as well as "new" apps created in order to test this issue.
I followed the instructions on vscode site (https://code.visualstudio.com/docs/nodejs/nodejs-debugging) with no success.
Runtime works great - just fail to debug.
Behavior consist on all machine's users (admin/non-admin)
Does anyone have a clue?
My environment setup is:
operating System: Windows 10 Pro version 1803
node version: v10.13.0
vscode version: 1.28.2
This is vscode's trace (note the target not opened warning):
OS: win32 x64
Adapter node: v8.9.3 x64
vscode-chrome-debug-core: 6.7.19
11:20:18 AM, 11/7/2018
node-debug2: 1.28.3
From client: initialize({"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"node2","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"})
To client: {"seq":0,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"exceptionBreakpointFilters":[{"label":"All Exceptions","filter":"all","default":false},{"label":"Uncaught Exceptions","filter":"uncaught","default":false}],"supportsConfigurationDoneRequest":true,"supportsSetVariable":true,"supportsConditionalBreakpoints":true,"supportsCompletionsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsRestartFrame":true,"supportsExceptionInfoRequest":true,"supportsDelayedStackTraceLoading":true,"supportsValueFormattingOptions":true,"supportsEvaluateForHovers":true,"supportsLoadedSourcesRequest":true,"supportsLogPoints":true,"supportsTerminateRequest":false}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/initialize","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","successful":"true","timeTakenInMilliseconds":"3.774888","requestType":"request"}}}
From client: attach({"type":"node2","request":"attach","name":"Attach by Process ID","trace":true,"cwd":"c:\\Users\\roi\\dev\\janus\\src\\tools\\magento2-importer","port":9229,"protocol":"inspector","logFilePath":"c:\\Users\\roi\\AppData\\Roaming\\Code\\logs\\20181107T103352\\exthost1\\ms-vscode.node-debug\\debugadapter.txt","__sessionId":"910bc34a-3629-46b7-8c57-e89c06f5bda0"})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"debugStarted","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","request":"attach","args":["type","request","name","trace","cwd","port","protocol","logFilePath","__sessionId","enableSourceMapCaching","sourceMapPathOverrides","showAsyncStacks","sourceMaps"]}}}
Getting browser and debug protocol version via http://127.0.0.1:9229/json/version
Discovering targets via http://127.0.0.1:9229/json/list
Got browser version: node.js/v10.13.0
Got debug protocol version: 1.1
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetDebugProtocolVersion","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3"}}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"targetCount","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","numTargets":1}}}
Attaching to target: {"description":"node.js instance","devtoolsFrontendUrl":"chrome-devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&ws=localhost/a575db9e-d5a5-46a5-a49c-a553228c7493","devtoolsFrontendUrlCompat":"chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost/a575db9e-d5a5-46a5-a49c-a553228c7493","faviconUrl":"https://nodejs.org/static/favicon.ico","id":"a575db9e-d5a5-46a5-a49c-a553228c7493","title":"dist/server.js","type":"node","url":"file://C:_Users_roi_dev_janus_src_tools_magento2-importer_dist_server.js","webSocketDebuggerUrl":"ws://127.0.0.1:9229/a575db9e-d5a5-46a5-a49c-a553228c7493","version":{}}
WebSocket Url: ws://127.0.0.1:9229/a575db9e-d5a5-46a5-a49c-a553228c7493
→ To target: "{\"id\":1,\"method\":\"Console.enable\"}"
→ To target: "{\"id\":2,\"method\":\"Debugger.enable\"}"
→ To target: "{\"id\":3,\"method\":\"Runtime.enable\"}"
→ To target: "{\"id\":4,\"method\":\"Log.enable\"}"
→ To target: "{\"id\":5,\"method\":\"Runtime.runIfWaitingForDebugger\"}"
→ Warning: Target not open! Message: "{\"id\":6,\"method\":\"Runtime.run\"}"
Websocket closed
Terminated: websocket closed
Waiting for any pending steps or log messages.
Current step and log messages complete
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"debugStopped","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","reason":"websocket closed"}}}
To client: {"seq":0,"type":"event","event":"terminated"}
From client: disconnect({"restart":false})
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"FullSessionStatistics/SourceMaps/Overrides","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","aspNetClientAppFallbackCount":0}}}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"report-start-up-timings","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","RequestedContentWasDetected":"false","Steps":"[\"BeforeFirstStep\",\"ClientRequest/initialize\",\"ClientRequest/attach\",\"Attach\",\"Attach.RequestDebuggerTargetsInformation\",\"Attach.ProcessDebuggerTargetsInformation\",\"Attach.AttachToTargetDebuggerWebsocket\",\"Attach.ConfigureDebuggingSession.Internal\",\"Attach.ConfigureDebuggingSession.Target\"]","All":"380.614371","BeforeFirstStep":"[18.487202]","WaitingAfter.ClientRequest/initialize":"[22.151169]","ClientRequest/initialize":"[4.841868]","ClientRequest/attach":"[4.11239]","Attach":"[8.248859]","Attach.RequestDebuggerTargetsInformation":"[12.433092]","Attach.ProcessDebuggerTargetsInformation":"[0.720004]","Attach.AttachToTargetDebuggerWebsocket":"[317.133643]","Attach.ConfigureDebuggingSession.Internal":"[0.81632]","Attach.ConfigureDebuggingSession.Target":"[13.309018]","RequestedContentWasNotDetectedReason":"shutdown"}}}
Terminated: Got disconnect request
To client: {"seq":0,"type":"response","request_seq":3,"command":"disconnect","success":true}
To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/disconnect","data":{"Versions.DebugAdapterCore":"6.7.19","Versions.DebugAdapter":"1.28.3","successful":"true","timeTakenInMilliseconds":"2.443434","requestType":"request"}}}
This is snippet of vscode screen after debuger was attached. as you can see debugger was attached, but no debug tool bar is present (and no breaks on breakpoints):
You can try to add launch.json by go to Debug->Add Configuration
And then choose Node.js Attach To Process
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach by Process ID",
"processId": "${command:PickProcess}"
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": Your Port,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": null
}
]
}
Then run you server as usual, for example
> nodemon app.js
Set breakpoints
And hit Start Debugging
The debugger should kick in and you should smile :)
I am running VS code tool and run it on windows, after creating a sample project react-native init testProject
I try to debug the application by debugging it. i attached an android configuration:
"configurations": [
{
"name": "Debug Android",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "android",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
am having an issue to debug and run the app, i spent hours to try to figure it out without success, i downgrade the cli to 1.0, adb kill-server but no success, every time i have the error:
I am running out of idea, what can i do more ?
Thanks
ah after hours of searching, trial and errors, reinstalling the cli, react native, upgrading without success....
I tried to disable the avast antivirus and unbelievable, the error is coming from that !
I'm trying to include aurelia-tabbed in my aurelia project (of which I think I have the latest version, but I can't find a version number anywhere). I have a problem however, because I'm using a bundle of my app and vendor js, and I don't know how to include the package.
I've tried adding this in my aurelia.json in build > bundles > (vendor) > dependencies:
{
"name": "aurelia-tabbed",
"path": "../node_modules/aurelia-tabbed/dist/amd",
"main": "index",
"resources": ["assets/tabs.css"]
},
However, while this compiles, I cannot run the webpage. It gives me errors in the console (even before I add any of the tabbed tags):
DEBUG [aurelia] Configured plugin aurelia-tabbed.
vendor-bundle.js:5700 GET http://localhost:9001/analysis/test-page/node_modules/aurelia-tabbed/dist/amd/tab-headers.js
vendor-bundle.js:5700 GET http://localhost:9001/analysis/test-page/node_modules/aurelia-tabbed/dist/amd/tabs-wrapper.js
vendor-bundle.js:5700 GET http://localhost:9001/analysis/test-page/node_modules/aurelia-tabbed/dist/amd/tab-content.js
vendor-bundle.js:1395 Unhandled rejection Error: Script error for "aurelia-tabbed/tab-headers"
http://requirejs.org/docs/errors.html#scripterror
at makeError (http://localhost:9001/scripts/vendor-bundle.js:3907:17)
at HTMLScriptElement.onScriptError (http://localhost:9001/scripts/vendor-bundle.js:5477:36)
The three calls all result in 404's (which is normal, because the node_modules path is located at the root).
However: why are the three calls even made? Aren't the files supposed to be bundled?
In your aurelia.json file, you need to list all resources of the plugin. Try the following:
{
"name": "aurelia-tabbed",
"path": "../node_modules/aurelia-tabbed/dist/amd",
"main": "index",
"resources": [
"tab-content.html",
"tab-headers.html",
"tabs-wrapper.html",
"assets/tabs.css"
]
},
I'm trying to get Durandal.js optimizer working on my test project, but it seems to generate nothing to main-built.js. I use the following command from node.js command prompt, in durandal/amd folder:
optimizer.exe --verbose true
Result is
Using default base configuration.
Configuring for deploy with almond (custom).
{
"name": "durandal/amd/almond-custom",
"inlineText": true,
"stubModules": [
"durandal/amd/text"
],
"paths": {
"text": "durandal/amd/text"
},
"baseUrl": "C:\\Users\\Tommi Gustafsson\\Documents\\Visual Studio 2012\\Projects\\DurandalTests\\DurandalTest1\\TestApp",
"mainConfigFile": "C:\\Users\\Tommi Gustafsson\\Documents\\Visual Studio 2012\\Projects\\DurandalTests\\DurandalTest1\\TestApp\\main.js",
"include": [
"main-built",
"main",
"bindings/tinymce-binding",
"durandal/app",
"durandal/composition",
"durandal/events",
"durandal/http",
"text!durandal/messageBox.html",
"durandal/messageBox",
"durandal/modalDialog",
"durandal/system",
"durandal/viewEngine",
"durandal/viewLocator",
"durandal/viewModel",
"durandal/viewModelBinder",
"durandal/widget",
"durandal/plugins/router",
"durandal/transitions/entrance",
"raphael-amd/eve.0.3.4",
"raphael-amd/raphael.2.1.0.amd",
"raphael-amd/raphael.2.1.0.core",
"raphael-amd/raphael.2.1.0.svg",
"raphael-amd/raphael.2.1.0.vml",
"viewmodels/flickr",
"viewmodels/modal1",
"viewmodels/myPage",
"viewmodels/shell",
"viewmodels/welcome",
"text!views/detail.html",
"text!views/flickr.html",
"text!views/modal1.html",
"text!views/myPage.html",
"text!views/shell.html",
"text!views/welcome.html"
],
"exclude": [],
"keepBuildDir": true,
"optimize": "uglify2",
"out": "C:\\Users\\Tommi Gustafsson\\Documents\\Visual Studio 2012\\Projects\\DurandalTests\\DurandalTest1\\TestApp\\main-built.js",
"pragmas": {
"build": true
},
"wrap": true,
"insertRequire": [
"main"
]
}
Deleting old output file.
Tracing dependencies for: durandal/amd/almond-custom
Then, when I check main-built.js, it is empty. Can anyone help me what is the problem? I have several AMD modules in the test project, including Raphael.js AMD modules.
My requirejs configuration looks like this:
requirejs.config({
paths: {
'text': 'durandal/amd/text',
'eve': './raphael-amd/eve.0.3.4',
'raphael.core': './raphael-amd/raphael.2.1.0.core',
'raphael.svg': './raphael-amd/raphael.2.1.0.svg',
'raphael.vml': './raphael-amd/raphael.2.1.0.vml',
'raphael': './raphael-amd/raphael.2.1.0.amd',
'tinymce': "../Scripts/tinymce/jquery.tinymce.min"
}
});
In the same amd folder, where optimizer is stored, try running node r.js -o app.build.js. I've seen r.js sometimes choke about some dependencies, which resolves without problem when loading via require.js. For whatever reason the error messages won't show up when using optimizer --verbose. Typically the error message provides enough information to see where this occurs and if you've to update require.contig.paths or a specific define dependency.