How to debug Meteor in IntelliJ - javascript

I want to debug javascript code of Meteor apps in IntelliJ.
I read the instructions in the following tutorials:
http://www.jetbrains.com/idea/webhelp/running-and-debugging-node-js.html
http://wiki.jetbrains.net/intellij/Remote_JavaScript_debugging_with_WebStorm_and_PHPStorm
The first tutorial explains debugging a Node.js application. The second tutorial explains debugging a javascript application.
Could someone explain how to debug meteor apps in Intellij?

there is an instruction here (please add your vote) but the issue is you need to restart the debugger every time you make a change because meteor restarts the nodejs process.
starting your application with ´NODE_OPTION="--debug"´ allows you to debug in ´node-inspector´ with the same limitation (restart after every change). instructions here
My experience with IntelliJ is that even if restarted every time, the javascript debugger will struggle to reconnect. I use IntelliJ for development but node-inspector for debugging.

Related

getting jdk and intellicode errors in vs code. how do i fix it?

I am a very early beginner to coding. I downloaded VS Code so that I could, you know, have somewhere to code in Java. However, I keep getting these two errors telling me these two extensions that I already have installed on VS Code are not working here are the error messages. I already searched through the odds and ends of StackOverflow and have tried everything, and nothing has worked. Any help would be appreciated.
I inputted some code into settings.json under a "java.configuration.runtimes" thing but nothing in it worked. I conformed it to my installation directories and current Java version
Do you have a JDK (Java Development Kit) installed?
If you are on Windows, you can check by clicking on the start button, and search through applications and programs for a Java folder.
If you are on MacOS or Linux, you can open up the terminal/command line and type in "java -version" and if it is properly installed, it will display the version.
If you do not find a JDK installed, install one from https://www.oracle.com/ca-en/java/technologies/downloads/
Download and install the Coding Pack for Java.
It would be helpful to follow this documentation to get started.

Unit testing javascript (NOT node)

I am scratching my head at this one, I must have missed something really obvious.
I have a .Net ASP MVC Web app, developed with VS2015, in which I have written some library javascript code. I would like to have some simple tests for this javascript code that I can run in my dev environment, on my own machine. I have no IIS server locally. (The server side code is fine, I use NUnit and VSs Testrunner).
I have read about Mocha (and used it back end), QUnit etc - but anything whose installation and use instructions start npm install and talks about running grunt jobs is not what I am after.
Can someone point me in the right direction / educate me?
If you are up for using pluralsight, it is what got me started. There is a free trial and quite a few videos on testing mvc.

How to run and debug an AngularJS application in Eclipse?

I'm trying to get started with Nodeclipse. I would like to run and debug an AngularJS application, e.g. the angular-phonecat example from Eclipse.
In particular, I would like to
use a Debug on Server launcher to start a server with my application and open a web browser (Firefox or Chromium).
set a breakpoint in a JavaScript file in Eclipse
click around in the web browser and have the Eclipse debugger stop at the breakpoint.
(The equivalent of this does work in NetBeans in a very intuitive way.)
From the Nodeclipse help, I don't see how to get started or whether this is possible at all.
I managed to run an debug a Node.js project with the Hello World template, but I don't see how to debug anything running in a web browser.
Does that require a Remote Javascript debug launcher? If so, how to use it?
Finally, I don't see how to actually run an AngularJS application in Nodeclipse. As far as I can tell, the AngularJS Eclipse plugin only implements editing features but does not deal with running and debugging. Do I need to turn the Angular project into a Node.js application? If so, how?
AngularJS runs in browser, Node.js on server,
so you need different approaches.
Nodeclipse is primarily about supporting Node.js and has ChromeDevTools-based debugger. I cannot tell what is best for debugging browser JavaScript, maybe it is Chrome browser.
managed to run an debug a Node.js project with the Hello World template, but I don't see how to debug anything running in a web browser.
Ask on https://github.com/angelozerr/angularjs-eclipse/
Do I need to turn the Angular project into a Node.js application?
For Node.js run/debug it is not needed.

Meteor.js - can I drop into a Meteor shell to try out some JavaScript in my Meteor environment?

I often develop in Python and sometimes find it useful to type python at the terminal prompt and drop into a Python shell where I can import various modules and test some behavior. Node.js has similar functionality if I type node at the command line.
I'd like to do the same now that I'm developing with Meteor. How can I get to a shell prompt where all the packages I have added with meteor add are loaded and ready for me to play with?
Just install node-inspector and then you can easily use the node-debug command to run node-debug mrt. That should open a debugger console.
You can then just drop a debugger; keyword onto a line anywhere in your code to drop into a REPL like setting.
As of recently, meteor shell will give you a REPL into the server process.
Of course, you know this #JoshOwens, I think I heard about this on your podcast :)
Node.js and python are both interpreters.
Meteor is a application framework build upon node.js. So testing out code in the way you mentioned is impossible.
You can however use the chrome debugging tools to run client side code within your meteor application.
Executing server side code to see what it does is a bit harder but also not impossible. Best way would probaply to setup nodejs remote debugging and using the debugger. See: Meteor debugging setup

Meteor JS, running in a debugger?

I'm curious if anyone has a solution for running meteor in a debugger. I have some experience with running regular node in a debugger, have used JetBrains Webstorm for this, however it doesn't seem to support meteor (as far as I can tell). If anyone has a solution, would appreciate any information. It seems, eventually this will need to be possible for meteor to become a longterm viable platform.
It looks like the meteor startup script does not support a debugging option at this point, but you can fix this yourself:
Open the meteor startup script in a text editor (use which meteor to find it)
Change the last line (add $NODE_DEBUG parameter):
exec "$DEV_BUNDLE/bin/node" $NODE_DEBUG "$METEOR" "$#"
Now you can launch meteor in debug mode like this:
NODE_DEBUG=--debug meteor

Categories