How to debug server side code in a Meteor app

微笑、不失礼 提交于 2019-11-27 20:17:26

So here is how I managed it for meteor 0.5.6

there is no need to tinker with the run.js anymore

install node-inspector https://github.com/dannycoates/node-inspector

create an environment variable export NODE_OPTIONS='--debug'

run meteor or mrt command. It should tell you something like debugger listening on port 5858

Once the debugger is listening, you can start node-inspector and point your browser to Visit http://127.0.0.1:8080/debug?port=5858

I had a lot of fun with it :-)

For meteor 1.2.x and onward, everything is packaged in. Simply run meteor debug and connect to the provided url

In this video Slava Kim explains how someone can debug a Meteor app at server side. First you have to install node-inspector

npm install -g node-inspector

and then run the Meteor app with a specific variable

env NODE_OPTIONS="--debug" meteor

in new terminal tab open the node-inspector by run the command

node-inspector

copy and paste the url from node-inspector on Chrome and you will find all the server side code to set breakpoints for debug. Important: Set the breakpoints on your project's files at the (no domain) folder

I use both Node-inspector and Loggly to debug my Meteor server.

Node-inspector is AWESOME but if I have testers telling me about issues or issues happen in production, it doesn't tell me about EXACTLY what they did or what hardware/network conditions they're on. Logging however can tell you about the step & conditions that caused an issue which allows you debug with better information.

AlikElzin-kilaka

As of Meteor 1.1.0.2, meteor debug does the trick on Meteor 1.1.0.2.

See more info here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!