Posts

Showing posts with the label Visual Studio Code

"Cannot Find Debug Adapter For Type 'node'. "

Answer : I had to restart vscode. Not sure if it's connected but my app crashed because of JavaScript heap out of memory error. Just install the older 'Node Debug' version from the VSC market place. In my case 1.33 did n't and 1.31 works. To debug node js on vs-code two extensions are required. Node Debug Node Debug(legacy) install or enable both and reload. reason for requiring both mentioned here "Node Debug (legacy)" is important because it delegates to "Node Debug" for Node.js versions >= 8.0. Without "Node Debug (legacy)" node debugging is basically disabled because nobody will delegate.

Can't Zoom Out In Visual Studio Code

Answer : On-Screen keyboard did not work for me. But managed to click the reset zoom setting under View>Appearance>Reset Zoom. Zoom Out option was not working. However, Zoom was reset after clicking Reset Zoom option. Found the solution by opening the on-screen keyboard, activating the numeric pad, and using its - . The - is not working on my laptop. On my installation the keyboard shortcuts are working as stated in documentation ( CTRL + - ). For a workaround you can perhaps use the menu items under View > Zoom Out as also written in documentation in Chapter Zoom.

Can't Push Refs To Remote Try Running Pull First To Integrate Your Changes

Answer : You get this try running pull first to integrate your changes whenever your local branch and your remote branch are not on the same point, before your changes. remote branch commits : A -> B -> C -> D local branch commits : A -> B -> C -> Local_Commits Now clearly, there's a change D that you don't have integrated locally. So you need to rebase , then push, which will lead to the following. remote branch commits : A -> B -> C -> D local branch commits : A -> B -> C -> D -> Local_Commits To solve your issue, do the following git pull --rebase origin branchname git push origin branchname I was getting this message in my Azure DevOps Repos environment because the server had a branch policy on the master branch that requires pull request approval and I was trying to push to master directly. Even after pull and rebase the same message appears. I don't think VS Code really knows how to interpret this specific err...

Cannot Debug In VS Code By Attaching To Chrome

Answer : You need to install Debugger for Chrome extension for this to work. Open extensions in VS Code and search for Debugger for Chrome You need to run a web server on the URL specified in the first configuration (default to http://localhost:8080). I use serve npm package that I installed globally. From my app folder I run serve -p 8080 Select Launch Chrome against localhost option. It will launch the browser and you can set breakpoints in your code and the debugging should work. Regarding the second configuration (Attach to Chrome). There's nothing special about the port. In order to attach to Chrome you need to run Chrome with remote debugging enabled on port specified in the config. For example chrome.exe --remote-debugging-port=9222 . I personally never use this options. Just follow the three steps above and you should be fine. When using the configuration url , vscode will search for a tab with the EXACT url and attach to it if found. Use the configuration urlFi...

Can't Debug Current Typescript File In VS Code Because Corresponding JavaScript Cannot Be Found

Answer : The problem may be with your map files and not with configuration. Before trying anything else you want to make sure your paths that you are using in your launch configuration are correct. You can do so by substituting the paths with absolute paths on your system temporarily to see if it works. If it does not work you should: Check your tsconfig and make sure mapRoot under compilerOptions is not set to anything. This is what official documentation has to say about it: Specifies the location where debugger should locate map files instead of generated locations. Use this flag if the .map files will be located at run-time in a different location than the .js files. The location specified will be embedded in the sourceMap to direct the debugger where the map files will be located. You can read more about it here In most of the cases, you don't really want to set it to anything. Also, make sure that "sourceMap" : true` is set in co...