-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to debug Meteor app? #256
Comments
Have you tried to debug it like any other node app? |
Closing until more info is provided |
Hi, trying to do the same, wondering what would be js file to use as entry point for the debugger (for node is app.js). any help would be much appreciated ! |
Can you provide a minimum sample workspace for which we can try this out? |
Hi @isidorn , thanks for the quick reply. |
Ok what seems to be somewhat working for me is the following:
@george2giga can you please try this? |
Thanks @isidorn , works a charm :) |
Glad it worked. Closing this |
Hi. I tried what you said, and vscode started debugging! but doesn't stop in my breakpoints. is there something that I'm missing? |
@winuxue please open a new issue with reproducable steps (possibly a small sample) so we could investigate this further. |
@isidorn check if port is really 5858, in my case was 5959 |
Any example using Meteor settings? For example with the following command:
Thanks in advance, Nicholls |
I can attach to the running process and set a breakpoint. But as soon as I change any server side code, meteor restarts (normal for meteor) and the debug process disconnects. then execution goes past my breakpoint because at that time, the debugger is not listening. I suspect this is what was happening @winuxue has anybody got this working correctly? a |
@camstuart I'm in the exact same situation here, I came to the same conclusion. |
Ok seems to be no longer working looking at the comments -> reopening and assigning to april to investigate |
@camstuart @Exilz can you please try adding |
im having the exact same bug @Exilz |
Assigning to @weinand as I am out of ideas |
It works for me. I found that even though meteor tells me to use 5858 its really 5959. meteor debug and meteor tells To debug the server process using a graphical debugging interface, http://localhost:8080/?port=5858 but this launch config works
|
You can use |
Good news! Update Meteor: In launch.json:
In package.json:
And now it supports VScode breakpoints! 👍 |
@MartinBucko thanks for letting us know, closing this issue then |
2. setup launch.json of Visual Studio Code. Ref: microsoft/vscode#256 (comment), https://forums.meteor.com/t/using-visual-studio-code-for-meteor-development/21058. But the debugger still can not work well in auto-restart case (meteor should auto-restart if codes change).
Just a little FYI for anyone finding this issue via Google as I have... Meteor runs 2 node processes, one that "builds" your app and then one that gets killed and restarted on every "hot code reload". Let's call them parent and child. The parent process is the one that listens on port 3000, and it proxies connections to the child process. That's how hot code reload works. I believe that it's doing the same from I find that I get better results running meteor with the
This results in the child process being run like I still can't get breakpoints to work though. Adding |
Why has this been closed? it still doesn't work for me on 1.5.1 (the current official, non-beta, release). |
Same here, can someone that already runs Meteor 1.6 confirm that the breakpoint issue is solved as well? Not just the debugger starting but that breakpoints are actually properly hit? Otherwise I would reopen this case. |
We need proper, comprehensive, instructions on how to set this up with Meteor -- to make sure some issues are not just because of configuration or process -- and then whatever falls out of that should be fixed. I've followed and added most-all configuration instructions, yet I still cannot get things working with breakpoints -- heck I can't even tell if its working at all. For now I'll have to stick with using the console/node-inspector for debugging sever side, and not get the full VSCode experiance I believe MS intended. NOTE: I'm on Meteor 1.5.1, and VSCode 1.15.1 |
My way:
|
My previously mentioned config works with meteor 1.6-beta.15 (node v8.2.1, correct version for node inspector) but not with Meteor 1.5 (lower node version, don't support inspector!)... |
@Miniwe Which versions (Meteor, nodejs, ...) is this for? Thanks |
@Miniwe Is it really necessary to select the meteor process with the process picker in the launch config from above? If meteor is launched in debug mode, then specifying the port is all you need to attach the debugger. Attaching by processId (or with the picker) is only useful if meteor was not started in debug mode. The "outfiles" attributes accepts glob patterns, so you can just set it to this:
This selects all *.js files under the .meteor directory (on any folder level). |
Meteor 1.5.1 |
This should work as long as you're using a Meteor version that supports the Inspector protocol. I'm not super familiar with Meteor but from #256 (comment) it sounds like this will only work with Meteor 1.6+. This is because the inspector debug adapter supports the path mapping needed to fix Meteor's weird sourcemap paths, and fixes the default one automatically - https://github.com/Microsoft/vscode-node-debug2/blob/master/src/nodeDebugAdapter.ts#L26 |
We should create a Meteor recipe! |
Thank you @Miniwe, I wasn't expecting to have to set breakpoints outside of my actual source, I guess I#m spoiled by now. So from this thread and all others this is my current conclusion: Meteor pre 1.6 Post 1.6 ... preying for 1.6 to arrive soon :) |
@Miniwe Meteor 1.5.1 have node version 4.8.4 !
|
No description provided.
The text was updated successfully, but these errors were encountered: