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

Cannot set breakpoints where I choose #16170

Closed
RyanMitchellWilson opened this issue Nov 28, 2016 · 7 comments
Closed

Cannot set breakpoints where I choose #16170

RyanMitchellWilson opened this issue Nov 28, 2016 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s) upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@RyanMitchellWilson
Copy link

RyanMitchellWilson commented Nov 28, 2016

Every time that I try to set a breakpoint it automatically moves it to another point in my file. It should just set the breakpoint on the line that I choose not whatever it thinks is best.

screen shot 2016-11-28 at 1 53 29 pm

I chose line 307 here and it keeps moving it to line 316, which isn't even the same function. (You can see this at the bottom left of the screenshot). It should not be moving my breakpoint at all

  • VSCode Version: 1.7.2
  • OS Version: OSX Sierra 10.12.1
  • React-Native 0.30.0
  • Node 6.9.1
  • Babel-Register 6.11.6

Steps to Reproduce:

  1. Run Deugger
  2. Add/Remove Some Code
  3. Try to set a breakpoint
@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Nov 29, 2016
@RyanMitchellWilson
Copy link
Author

RyanMitchellWilson commented Dec 1, 2016

I am using babel and node in my project so it could be related to this #5728

@roblourens roblourens assigned roblourens and unassigned alexdima Dec 1, 2016
@roblourens roblourens added the debug Debug viewlet, configurations, breakpoints, adapter issues label Dec 1, 2016
@roblourens
Copy link
Member

  1. In your launch config are you using type 'node', or 'node2'? Can you try the other one and see if there's a difference?
  2. Does it happen everywhere in your project or just that file/line?
  3. Does it break in the right place, but show the breakpoint in the wrong place?
  4. Is this a project that's available for me to try on github?

@RyanMitchellWilson
Copy link
Author

  1. Don't see 'node' anywhere in my launch.json file so this might not be a node problem.
  2. Seems to happen pretty much everywhere in project when I have 'React-Native: Run Packager' going and have the vscode debugger running. Could be a React-Native thing. Changes my break point if I have been editing the file with the packager running.
  3. Occasionally will break in the right place but mostly it breaks on the line the it moved the break point to. Which looking at the screen shot above you can see that it knows it is moving my break point bucause it shows Routes.js 307 -> 316
  4. Private project not on github.

@roblourens
Copy link
Member

Ok, so you're debugging with the react native extension? I don't know a lot about what issues you might see in that setup. I recommend filing an issue on their repo - https://github.com/Microsoft/vscode-react-native.

@RyanMitchellWilson
Copy link
Author

Alright can do

@basickarl
Copy link

@roblourens @RyanMitchellWilson I'm receiving the same issue, the breakpoints are jumping when using node2 as type. I'm also using babel.

When setting type to "node" it doesn't jump. Problem is that I see transpiled code though (babel).

Heres my launch option:

{
      "name": "Launch NPM start",
      "type": "node2",
      "smartStep": true,
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "runtimeExecutable": "/home/usr/.nvm/versions/node/v7.2.0/bin/node",
      "runtimeArgs": [
        "--harmony-async-await",
        "-r",
        "babel-register",
        "--debug-brk=5858",
        "${workspaceRoot}/src/index.js"
      ],
      "port": 5858,
      "env": {
        "PATH": "${env.PATH}:/home/usr/.nvm/versions/node/v7.2.0/bin/node",
        "NODE_PATH": "${workspaceRoot}"
      }
    }

.babelrc:

{
  "presets": [
    "es2015"
  ],
  "sourceMaps": "inline"
}

Heres a chronological display of how it looks (clicking on step over):

screenshot from 2016-12-02 14-23-17

screenshot from 2016-12-02 14-23-34

screenshot from 2016-12-02 14-23-46

screenshot from 2016-12-02 14-23-55

screenshot from 2016-12-02 14-24-03

screenshot from 2016-12-02 14-24-12

screenshot from 2016-12-02 14-24-21

screenshot from 2016-12-02 14-24-31

screenshot from 2016-12-02 14-24-44

@roblourens
Copy link
Member

roblourens commented Dec 2, 2016

@basickarl You probably just need to set "sourceMaps": true to have it use sourcemaps

microsoft/vscode-chrome-debug-core#134

@dbaeumer dbaeumer added upstream Issue identified as 'upstream' component related (exists outside of VS Code) *duplicate Issue identified as a duplicate of another issue(s) labels Dec 8, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues *duplicate Issue identified as a duplicate of another issue(s) upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

6 participants