You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have simple React app, using typescript.
Debugger works fine most of the time, but breakpoints in simple event handlers aren't hit.
Here's the relevant code snippet:
exportdefaultclassSearchextendsReact.Component{searchTextChanged(e){constquery=e.target.value;// <-- breakpoints aren't hit hereconsole.log("Search: ",query)}render(){return(<divclassName="search"><inputdefaultValue="Search for"onInput={e=>this.searchTextChanged(e)}></input></div>)}}
I even tried to call another method from searchTextChanged, breakpoints in it haven't hit as well.
I also tried to use bind in the onInput expression, it had no effect as well. (maybe on nonbeta fiorefox the version with bind hasn't hit, but using arrow function was fine)
Thanks for the sample code, I tried it and could hit a breakpoint in the event handler.
After some experimentation I found that breakpoints stop working completely when I change a source file while the dev server is running. The only way to get breakpoints working again is to restart the dev server but they will stop working again once you change a source file.
This seems to be due to facebook/create-react-app#6074 - a bug in CRA that has been reported more than a year ago and still isn't fixed. It affects debugging in Chrome, VSCode/Chrome and VSCode/Firefox. Only the devtools built into Firefox don't seem to be affected, I'll try to find out how they work around this bug.
Could you please verify that this is indeed the same issue that you are seeing? Please try restarting the dev server and then check if breakpoints start working again.
Thanks for investigating this issue.
You're completely right, with a fresh dev server start, I can debug all kinds of codes.
Probably I newly added the event handler function, when I was experiencing this issue, and this has nothing to do with firefox nor with the debug extension.
I will try to use some other kind of dev server, or start a new instance, when I want to debug.
I have simple React app, using typescript.
Debugger works fine most of the time, but breakpoints in simple event handlers aren't hit.
Here's the relevant code snippet:
I even tried to call another method from searchTextChanged, breakpoints in it haven't hit as well.
I also tried to use
bind
in the onInput expression, it had no effect as well. (maybe on nonbeta fiorefox the version with bind hasn't hit, but using arrow function was fine)Setup
I'm using firefox version 76.0b5 (64-bit)
launch.json:
The text was updated successfully, but these errors were encountered: