Set Dart breakpoints in WebStorm - debugging

Dart code execution does not pause at breakpoints set in WebStorm IDE.
The browser config points at a local Dartium install (/home/tom/dart/chromium/chrome-wrapper).
The Chrome extension has been installed.
Clicking on "Debug index.html" in the IDE causes Dartium to be launched. "JetBrains IDE Support is debugging this tab" displays in Dartium.
Any hints as to where to look for a problem?
Edit: I think it's transpiling. Here's the log:
[web] GET /begin/index.html => polymer_and_dart|web/begin/index.html
[web] GET /packages/web_components/dart_support.js =>
web_components|lib/dart_support.js [web] GET
/packages/web_components/webcomponents.js =>
web_components|lib/webcomponents.js
...

There are 2 rather good articles on the topic:
https://medium.com/#kasperpeulen/debugging-dart-in-webstorm-c118c059cca3
https://medium.com/#kasperpeulen/debugging-dart-in-webstorm-part-2-673048da2a3f
While I might not know why exactly you cannot debug your application, reading through these might give you the answer what Kasper (author of the articles) does to make it work.

Download fresh Dartium, set path to it in Settings (Preferences) | Languages and Frameworks | Dart. I'd recommend to update Dart SDK as well.
Check that run configuration for your html file is configured to start in Dartium (Run | Edit Configurations, for historical reasons its type is 'JavaScript Debug Run Configuration').

Related

visual studio code "launch json" on run, how to set debug console as default

I went to user settings to set the debug console to default (when I try to debug now the default console is terminal. I lose the small debug icons to skip, stop etc even when I manually select debug console). I am watching Python tutorials using Vs Code and his default is debug. How can I do this?
Secondly, when I try to run or debug, I am prompted to open LaunchJS, even if it is already open. I attempted to run it using the debug selection "current file, integrated terminal" and also "Python: Attach". Neither will work although the JSON file has these options. I looked at some MS videos but I am not understanding the problem.
Any help is appreciated. Thanks.
I found the answer at this link: https://code.visualstudio.com/docs/python/python-tutorial
I had not selectd a Python interpreter which establishes a python workspace. Was just trying to run with debugger. A simple program now runs. My guess is that the Python tutorial I selected is too old to follow with this version of VS Code, since I am unfamiliar with any version of VS Code.
Thanks.

How to use WebStorm JavaScript Debug configuration without Google Chrome?

I have FF (v.35), Opera (v.12), and IE (v.11) installed on my Win 7 x64 PC and wanted to debug a (locally stored) HTML file that loads a JS script.
After adding the file to a new project, I went to File > Settings > Tools > Web Browsers and unticked the web browsers that I do not have installed.
So those settings now looks like this:
After that I went to "Edit Configurations" and added the HTML file that I wanted to debug, as shown below:
(note that the HTML file is not empty, even though it is named that way)
Now if I click on the 'Debug (default)' button, I get these messages that Windows has a problem finding chrome and WebStorm is waiting for a connection from the Chrome plugin:
On another hand, if I click on the 'Run (default)' button it opens the page in Firefox as expected.
I am either doing something wrong or have something misconfigured.
How can I tell WebStorm not to use Chrome for debugging?
Thanks,
Simply put, JetBrains WebStorm does not support the JavaScript Debug configuration in any browser other than Chrome (or other Chrome-based browser such as Dartium).
To debug in FireFox versions 33-35 (for WebStorm v.10 this does not work in FF v.36), you have to enable Remote debugging in Firefox and then use the Firefox Remote run configuration, as explained here: https://youtrack.jetbrains.com/issue/WEB-13801#comment=27-904044.
ATM run/debug configuration of "JavaScript Debug" type only supports Chrome.
https://youtrack.jetbrains.com/issue/WEB-14987 -- watch this ticket (star/vote/comment) to get notified on progress (currently planned for WebStorm v11).
To debug using Firefox you have to use "Firefox Remote" type of configuration instead (for additional stuff /issues -- see related tickets).

How to debug firefox extension after cfx run?

I want to debug my firefox extension. I set
javascript.options.showInConsole = true
devtools.chrome.enabled: true
devtools.debugger.remote-enabled: true
run in sdk console cfx run, after that i go to Web Developer -> Browser Toolbox get incoming connection and i see my extension main.js. But after that, the code in main.js already been executed. How to debug it after cfx run?
also, two other things might be messing with your approach:
1) when you use cfx run, that by default creates a new profile on every run, so any settings that you have changed will not persist. to avoid this, you need to specify a profile directory with --profiledir=DIR (warning: don't use your main profile).
2) if the addon main.js code has already run by the time you open the debugger, you should start firefox manually, setup the debugger, and then drag the addon xpi into a tab.
Bug 899054 - [Meta] Implement an Add-on Debugger
this is really close to landing (the UI bits in bug 911098 are in m-c), so if you grab a Nightly tomorrow, or the day after, it should be in there, and might just work (for some undefined value of "work").

Why does WebStorm's LiveEdit not work in Chrome?

I am exploring WebStorm's trial version and would like to use the LiveEdit features.
I am not able to use the LiveEdit features after performing the following actions:
Made sure that LiveEdit is turned on
Installed the Chrome extension
Restarted the browser after installing the extension (I still suspect it is not required)
Run the HTML page in chrome
When I modify the HTML body, I don't see the changes reflected in Chrome.
I read on a forum that netty is not required.
Do we need it?
What else do I need to configure so that I can use the LiveEdit feature?
PS: I am using WebStorm 5.0.
Do you happen to have IntelliJ open by chance?
The point is that the port, 63342, is 'seized' by another app (even if it has nothing to do with HTML debugging).
When the port is busy, LiveEdit tries the next one, 63343. If you right click the JB icon on Chrome, choose Options, increment the port by one, and press Apply, you will magically connect. I wish Jetbrains would have bothered to inform the user what is the port that they are currently attempting to use.
In my PC it happened when I had Mac on. Either one of the following worked:
1. Kill IntelliJ IDEA (that was also open) and try again
2. Increment the port by one as I mentioned above.
I had to go to Run -> Debug (CTRL+F5 on Windows)
What helped in my case was activating "Can accept external connections" under the Settings -> Build, Execute, Deployment -> Debugger
WebStorm Settings
More details as requested:
Installed the JetBrains IDE Extension for Chrome
Make sure the LiveEdit Plugin is installed and activated (Settings -> Plugins)
Make sure "Can accept external connections" is checked (Settings -> Build, Execute, Deployment -> Debugger) AND Port is the same as in the Chrome Extension
Make sure Update ist set to "Auto in (ms)" e.g. 300 (Settings -> Build, Execute, Deployment -> Debugger -> Live Edit)
In my case live edit was just disabled (for some reason)
For anyone googling this thread, LiveEdit is now supported without a plugin. Just go into settings and uncheck "Use JetBrains IDE Support extension for debugging and Live Edit".
Without the extension, the debugging and live edit are more reliable based on my personal experience.
I couldn't make Chrome and Webstorm to link with each other. Chrome plugin was set to 63343 port or something like that.
I am on Windows. I opened command line with administrator privileges and typed:
netstat -a -b
to see all programs and ports they are listening to. I then found first entry regarding WebStorm.exe and saw that it was listening on port 30897. I set that port number in my chrome plugin options, and everything worked.
A quick fix: in the Chrome addon configuration, use the ip 0.0.0.0 for the host.
Turning off the automatic connection configuration from Internet Explorer properties worked for me smoothly. IE is the boss.

How to debug play2 in idea?

I found some articles on the internet and some discussions on google group, but they don't work any more.
How to do it with the latest play2-RC3 ?
You can start the play server in debug mode from console [docs], and should be able attach a debugger instance from Idea given that you know the port debugger is listening on.
I haven't use Idea so not sure if it is doable or not. It is fairly easy from netbeans. I suspect, it should be similar from Idea.
EDIT: They have also posted this in their customization guide for IDEs.
Debugging Play 2.x is very easy with IntelliJ IDEA 12.x, here are the steps you have to do:
Step 1. Enable the Play Framework Support plugin and the Play 2.0 Support plugin in File > Settings > Plugins.
The generic plugin usually comes with IntelliJ but make sure it's enabled. The Play 2.0 Support plugin can be downloaded by clicking Install Jetbrains plugin.... Simply locate and install the plugin from the list, the latest working version for 12.x is v.0.2.49. (it may prompt that a Scala plugin needs to be installed aswell)
Step 2. Create a new Play app if you haven't or use an existing one
Step 3. Create a new Debug configuration: Run > Edit configurations...
You can click the + icon in the top left corner to add a new configuration. Simply select Play 2 app from the list and give the configuration a name. The default options should be correct but feel free to change them if necessary. When done, click Apply and Ok.
Step 4. Your toolbar should now have a Run icon and a Debug icon enabled.
Simply click the green arrow to run the Play application. This is the equivalent of doing play run from the commandline (except without the commandline).
To debug, click the green bug, next the the arrow. This is the equivalent of doing play debug from the commandline.
You will now be able to debug when a breakpoint is encountered.
Notes:
Make sure there is only 1 configuration running at a time because Play doesn't like multiple instances running at the same time.
If you're having trouble compiling, do a play clean-all and play package on the commandline, this should resolve most problems. If there are further problems, also try play idea from the commandline.
Make sure the Play configuration is filled in in your settings. You can do this by going to File > Settings > Play Configuration.
A video of these steps can also be found in this video by James Ward (start at around 1:40 min.).
Go to Run -> DEBUG -> Edit Configurations
use "Remote" Configuration and set the Port to 9999

Resources