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

Debug only works after reloading page #316

Closed
ghost opened this issue Dec 25, 2016 · 3 comments
Closed

Debug only works after reloading page #316

ghost opened this issue Dec 25, 2016 · 3 comments

Comments

@ghost
Copy link

@ghost ghost commented Dec 25, 2016

I have to reload the page manually to get debug working. Does anyone else experience something like that? Despite debug works fine, its a little bit annoying after a while.

Iam also using webpack's dev server and anmodule which writes the source maps of my scripts to disk, called https://github.com/gajus/write-file-webpack-plugin. Maybe thats whats causing the problem, since the files are written to disk just after debug has been invoked?

launch.json

{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome against localhost, with sourcemaps",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080",
"sourceMaps": true,
"webRoot": "${workspaceRoot}"
},
{
"name": "Attach to Chrome, with sourcemaps",
"type": "chrome",
"request": "attach",
"port": 9222,
"sourceMaps": true,
"webRoot": "${workspaceRoot}/dist"
}
]
}

@auchenberg

This comment has been minimized.

Copy link
Contributor

@auchenberg auchenberg commented Dec 25, 2016

What functionality are you trying to debug? Code that's running immediately?

@ghost

This comment has been minimized.

Copy link
Author

@ghost ghost commented Dec 25, 2016

Yes, for example breakpoint at:

ReactDom.render()

Never the less, if I do enable 'halt on all exceptions' within vs code's debug tool, the app stops immediately after debug is started. I don't have to do an extra refresh.
I would except that behavior from any breakpoint set in the code manually after debug is started and the browser window opens.

@roblourens

This comment has been minimized.

Copy link
Member

@roblourens roblourens commented Jan 3, 2017

For code that runs immediately on page load, your breakpoints may not be hit until the page refreshes, since it's just a race to attach before that code executes. I don't have another workaround, sorry.

@roblourens roblourens closed this Jan 3, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.