Skip to content
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

Development: Add Visual Studio Code debugging configuration #10586

Merged
merged 1 commit into from
Apr 26, 2018

Conversation

graywolf336
Copy link
Contributor

Special thanks to @mrsimpson for his effort and research, we now have the ability to debug and step through the Rocket.Chat application via Visual Studio Code's amazing debugging!!

There are a few different configurations, so I'll explain what they are:

  • Attach to meteor debug - use this when you have already started the application via npm run debug
  • Frontend (Chrome) - this opens a new Chrome instance and allows debugging the client code inside of VSCode
  • Server (debug) - launches the server code but it only hits breakpoints after Meteor has started up
  • Server (debug-brk) - launches the server code, however it allows setting a breakpoint in code that Meteor calls during the startup phase
  • Server (Testmode) - works like the regular debug but has the environmental variable TEST_MODE set to true.
  • Server + Frontend - launches both the server and frontend, with the server being debug-brk

image

I personally use this and love it now. I nearly always start Rocket.Chat with this now ;)

Copy link
Contributor

@geekgonecrazy geekgonecrazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! 😀 I vote to include, especially since most of our team are vscode converts 😄

Also makes it so much easier for people to get started contributing

@sampaiodiego
Copy link
Member

awesome..

@mrsimpson
Copy link
Collaborator

Of course I vote to ship it ;)
Remarks:

  • I always start the server outside of VS Code and the attach. It feels more reliable and the risk of a timeout is zero
  • Once you restart the server while having it attached (e. g. since you change a server file), you need to re-attach manually
  • --inspect hardly has any negative impact on startup performance. I even though of having it as default for meteor npm start, since this is anyway only issued during development

@graywolf336
Copy link
Contributor Author

Thanks for those remarks! @mrsimpson :)

@graywolf336 graywolf336 merged commit 20ce928 into develop Apr 26, 2018
@graywolf336 graywolf336 deleted the development/allow-vscode-debug branch April 26, 2018 20:02
@rodrigok rodrigok mentioned this pull request Apr 28, 2018
trongthanh added a commit to goalifyplus/Goalify.Chat that referenced this pull request May 2, 2018
* develop:
  Regression: Various search provider fixes (RocketChat#10591)
  Fix /api/v1/settings.oauth not sending needed info for SAML & CAS (RocketChat#10596)
  Fix the Apps and Livechats not getting along well with each other (RocketChat#10598)
  [FIX] Missing "Administration" menu for users with some administration permissions (RocketChat#10551)
  [FIX] Member list search with no results (RocketChat#10599)
  Adds Visual Studio Code debugging configuration (RocketChat#10586)
  [FIX] Integrations with room data not having the usernames filled in (RocketChat#10576)
trongthanh added a commit to goalifyplus/Goalify.Chat that referenced this pull request May 2, 2018
* goalify: (104 commits)
  Regression: Various search provider fixes (RocketChat#10591)
  Supplement TOS and privacy policy texts for use within server instances
  Fix /api/v1/settings.oauth not sending needed info for SAML & CAS (RocketChat#10596)
  Fix the Apps and Livechats not getting along well with each other (RocketChat#10598)
  [FIX] Missing "Administration" menu for users with some administration permissions (RocketChat#10551)
  [FIX] Member list search with no results (RocketChat#10599)
  merge vi-VN and vi json
  Add and enhance translations
  Update gitlab, npm package lock, include current server update script
  Adds Visual Studio Code debugging configuration (RocketChat#10586)
  [FIX] Integrations with room data not having the usernames filled in (RocketChat#10576)
  fixed problems with margin negative (RocketChat#10558)
  Add some information regarding Zapier and Bots to the integrations page (RocketChat#10574)
  Added target="_blank" to homepage and support link. (RocketChat#10575)
  [FIX] Stop Firefox announcement overflowing viewport (RocketChat#10503)
  [FIX] Wordpress oAuth authentication wasn't behaving correctly (RocketChat#10550)
  Fix inconsistent response of settings.oauth endpoint (RocketChat#10553)
  Regression: Remove added mentions on quote/reply (RocketChat#10571)
  Fix the attachments and fields incorrectly failing on validation (RocketChat#10573)
  Deps update (RocketChat#10549)
  ...
@ForeverDreamer
Copy link

Under wsl ubuntu 20.04, when I start server, error occurs, anyone knows why?

/mnt/c/Program Files/nodejs//npm run debug-brk
Error: spawn /mnt/c/Program Files/nodejs//npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:81:21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants