How to debug Rocket.Chat/Apps-engine in an efficient way?
- 2020-10-28
- RocketChat
Tutorial
Start a RocketChat instance in debug mode with the command
meteor npm run debug
Open the link http://localhost:3000 (make sure the latest Google Chrome installed)
Open Chrome Devtools (In Mac, the shortcut is Command+Option+I)
Click the
Node.js
button at the top-left of the Chrome Devtools panel.The text in the
Connsole
tab should be like this:It indicates that Chrome Devtools has attached to RocketChat Node.js debugger successfully :)
Use the shourtcut Command+P to navigate the file you'd like to add breakpoints (It even supports
*.ts
files amazingly).Perform some operations to wait for the execution stops at the breakpoint you added. Happy Debugging!
Possible Issues
No Node.js button
There is no Node.js button at the top-left of the Chrome Devtool panel.
Make sure you start Rocket.Chat instance in debug mode with the command
meteor npm run debug
first.You might need to open the link about://inspect (You need to type it in the address bar manually) first.
- Click the link
Open dedicated DevTools for Node
- Add a new connection
localhost:9229
in theConnection
tab - Restart Google Chrome to try it again
- Click the link