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

breakpoints not working in vs code #8

Closed
matepaiva opened this issue Oct 16, 2017 · 5 comments
Closed

breakpoints not working in vs code #8

matepaiva opened this issue Oct 16, 2017 · 5 comments

Comments

@matepaiva
Copy link

Hey, great work! I became a big fan of this starter kit. The only thing that didn't worked as expected were the breakpoints in vscode. I know the problem is somewhere in babel, but I have no clue about how to fix it. Do you? If you could be my tutor in this mission, I could try to fix it myself. :)

Congratz, one more time!

@vmasto
Copy link
Owner

vmasto commented Oct 16, 2017

Hey, thanks for the kind words.

It's been a bit hectic lately so I do have some love showing owed to this starter kit. I'll try to help with the first chance. Until then, could you let me know how to reproduce the problem exactly. I don't use VSCode personally.

@matepaiva
Copy link
Author

Sorry for the late answer, @vmasto.

Anyway, my mistake. I didn't know how to setup vs code to attach debug. Now it works. Here is how I made it happen:

  1. At script dev on package.json, add --inspect flag:
    "nodemon src/index.js --exec \"node -r dotenv/config -r babel-register\""
    to
    "nodemon --inspect=22688 src/index.js --exec \"node -r dotenv/config -r babel-register\""
  2. Create a file at .vscode/launch.json with this configuration:
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "attach",
      "name": "Attach",
      "port": 22688,
      "restart": true,
      "sourceMaps": true,
      "stopOnEntry": false
    }
  ]
}
  1. After that, you start your server as usual, with npm run dev.

  2. Press F5 to attach the debugger to the server.

  3. You will see a message: "Debugger Attached". Yay!

How do you feel about adding some of these information to the README, or to another file linked to the README? If you are good with this, I could send you a PR with this info.

@vmasto
Copy link
Owner

vmasto commented Oct 27, 2017

Glad you solved the issue! I do think this kind of info is very valuable and should be in the README file. Can you create a new section under deployment perhaps titled "Debugging" and add that info as a generic way on how to attach the debugger, then specify the launch.json file in a subsection for VSCode? What do you think?

@matepaiva
Copy link
Author

Nice! I will try to work on it in the next few days.

@vmasto
Copy link
Owner

vmasto commented Mar 2, 2019

I've added a link to @matepaiva in the README file, closing this issue. Thanks a lot!

@vmasto vmasto closed this as completed Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants