Reacte Native Debugging with WebStorm - javascript

I've followed all steps here in order to debug RN app using WebStorm.
First time all worked: Chrome was opened and I was able to set breakpoints on WebStorm and to actual debug some code.
When I hit the debug button again on WebStorm, I got an error:
can't run debugger
I guess this is due to the fact that Chrome was not opened this time localhost:8081/debugger-ui
Since then tried much stuff (restarting Chrome, WebStorm, my Mac..). None helped.
I've downloaded Chrome again and now again WebStorm was able to open it. And again second time did not work.
I am able to debug manually using Chrome itself, but I'd really like to use WebStorm for debugging)
Any ideas how to tackle this?
Opening Chrome beforehand isn't working.

Looks similar to WEB-30438; the issue is fixed, fix will likely be available in the next 2017.3.3 EAP

Related

How can I resolve the Chrome warning: The deferred DOM Node could not be resolved to a valid node

I'm running a node.js project on a localhost server, and I've been doing this for months without seeing this, but recently, I've been getting this warning when I open the inspector:
The deferred DOM Node could not be resolved to a valid node.
I usually go into the inspector on an element to check out some attribute, eventListener, or other info, but this warning is popping up and it doesn't take me to the element. It's been pretty annoying, and I don't really know why it started showing up or how to get rid of it. My only clue is that I was changing some initialization settings for my express sessions around the same time this appeared, but I'm not sure that this is related.
Has anyone else run into this before? How do you get rid of the warning?
Thanks!
In my case, closing and reopening the browser window fixed it
That might be due to a chrome extension interfering. Make sure you test in an environment with no extensions like incognito mode.
This can occur when debugging in Visual Studio. Usually, restarting the debugger solves the problem
Open it in a incognito mode in chrome works!
I'm seeing this in Microsoft Edge right now (chromium version).
Never been aware of seeing it before and I don't have any extensions installed in Edge.
It currently works in Chrome! It also works in Edge in the live website but not my local machine.
In other words 🤷.

Debugging web-site not firing breakpoints using Edge

I have had this work in the past, but I'm currently experiencing a bizarre situation whereby I'm not hitting breakpoints on debugging using Edge.
Some points that I've established may be relevant during research (or just think are relevant):
I'm running under IISExpress
Works using Chrome
In internet options, I've disabled the "Disable script debugging" options for both IE and others
I am trying to debug typescript, but I get the same issue with a standard javascript file
I'm using VS2017
I am running in debug mode
I can hit the same breakpoint using F12 dev tools, so the code does get executed (VS also makes the breakpoint hollow, indiciating it knows it can't break there)
I feel like I'm missing something, after all, surely Edge is the one browser that should debug with VS.

How can I hit breakpoints (and see error line numbers) when debugging javascript on Android?

I'm trying to follow these instructions for debugging android javascript.
I am aware of How can I debug javascript on Android?, but it's not clear to me how (or if) I can hit breakpoints - either using Chrome on the Android device, or the Android browser.
I can see and 'inspect' the device OK:
But breakpoints don't get hit, nor can I see line numbers on the errors in the console:
Between these two problems, I'm not getting much useful information from the debugging experience! I have tried going to 'about:debug' in the android browser, and do see the debug options appear.
I will add that the js I am debugging works fine in the latest Chrome on the same Android device.
First off, it seems like there are a bunch of syntax errors that may be preventing mustache.js from executing at all - see if you can take care of those first.
I'd try setting a breakpoint on the next line down - line #9 - to see if anything in that IIFE is running at all.
Assuming you are using a module bundler (such as Webpack) in development (based on port 8080 in your screenshot), most likely the code you're trying to debug is executed via eval. In which case by the time you can see it in the devtools, it has already run.
You can either use the debugger statement in your code, or running in production mode - where there's a real script file being executed. In both cases, you should attach the remote debugger first, and only then navigate to your page (or refresh it).
I have now tried the same thing again, and this time didn't experience the problem. Unfortunately I can't put my finger on what the problem was exactly, as due to my dev machine dying I am running a new windows 10 installation, and potentially a different version of the Android SDK and ADB. The phone and android browser haven't changed.
Anyway, I can now set and hit breakpoints as I'd expect:
I also get better error descriptions and line numbers:
FWIW, the only problem that needed fixing was changing some 'let' declarations to 'var'.

Visual Studio 2013 can't debug javascript in cshtml

I have an ASP.NET Web Application created with Visual Studio 2013. I am attempting to debug JavaScript in a CSHTML file. However, whenever I launch the webpage, any breakpoint turns into a red circle arrow and states, "The breakpoint will not currently be hit. No executable code of the debugger's target code type is associated with this line. Possible causes include: conditional compiliation, compilier optimizations, or the target architecture of this line is not supported by the current debugger code type."
Recently, the project was switched over to support MVC and RAZR, neither of which I know well, and this is exactly when this issue began. However, searching those have yielded results that don't fix my issue.
Web.config:
<compilation debug="true"...>
I know I can debug JavaScript with Firebug or some other browser tool, but I would much rather stick with Visual Studio's debug as that is what I am used to.
So, apparently this is a "known issue" that will be fixed as soon as possible. A temporary work around that works for "some" people is making sure any Javascript is in a separate file.
It is caused by having RAZR and Javascript in the same file and Visual Studio 2013 not being able to handle debugging in that instance.
I don't know what your particular problem is, but if you want to force a debug breakpoint to always happen, add debugger; to the line that you want it to stop on, and it will stop. This is regardless of where the JS is located (in a .js file, .html, cshtml, etc.)
Here is a blog post about it:
http://sumitmaitra.wordpress.com/2013/12/11/quickbytes-visual-studio-2013-and-javascript-debugging/
I also agree that JS should go in a .js file (which I've never had a problem adding a break point in a .js file), but for quick prototyping, this is a solution you can use.
If that still doesn't work, you can always you the F12 tools
The only browser that allows debugging a javascript file from Visual Studio is Internet Explorer. (this is what I found out after testing my application on different browsers)
I put my javascript in a separate file and debug with IE otherwise it will not work.
For some reason chrome doesnt allow you to step into the javascript.
One additional thing to check. If you have a App_Start|BundleConfig.cs (which came with MVC 4 - or maybe 3), set BundleTable.EnableOptimizations to false (or, like I did, wrap it in an #if !DEBUG #endif and take the default setting).
I tried and failed to use Chrome and then IE and ended up using the Firebug addon in Firefox, and I was able to debug and set breakpoints in my JS with no problems (in an MVC6 app on Visual Studio 2015 where this is apparently still an issue?!)...
FYI - When I tried to debug my JS in Chrome using the F12 Developer Tools, it told me it was not an option as the Debugger was already attached to another process...
For people coming here in 2017, I want to share that I had this same issue with VS2017 Enterprise RC, and with VS 2015 Community with any browser but Internet Explorer. Using IE did the trick for me.
Also, in VS2017, I had to add a debugger statement to get VS start looking at debug points.
Finally, I'd like to ask at least a comment from people voting down.

Clear IE browsing cache from externally

I'm working on an ASP.NET app with Visual Studio.
The problem is that every time I launch the app, the IE has some css and js file cached so I have to manually clear the cache and only then run the app.
Added a external command in VS2012 that runs this tutorial but it runs only once and then it does nothing (I didn't check what triggers this one time).
I'm looking for either VS configuration, external tool, command line, anything that will let me clear the cache by a single click without the need to open the IE.
Thanks
OK, found a solution for my problem.
Don't know how I didn't see it before but the IE debugging window has a button for clearing the cache.
I couldn't find anything similar in Chrome (didn't look in FF and Safari) but for now I'm working only on IE so that's fine.
btw: I tried several other alternatives such as writing scripts/deleting registry entries but nothing worked. Some worked for the first time until next machine restart.
I hope someone can come up with a more efficient way.

Categories