CRA2 recommended config hits random break points in VS Code
See original GitHub issueIs this a bug report?
Yes
Did you try recovering your dependencies?
Yes
npm --version
6.4.1
yarn --version
1.10.1
Which terms did you search for in User Guide?
“vs code” debugger breakpoints
Environment
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Binaries:
Node: 10.10.0 - ~/.nvm/versions/node/v10.10.0/bin/node
Yarn: 1.10.1 - ~/.nvm/versions/node/v10.10.0/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.10.0/bin/npm
Browsers:
Chrome: 69.0.3497.100
Safari: 12.0
npmPackages:
react: ^16.5.2 => 16.5.2
react-dom: ^16.5.2 => 16.5.2
react-scripts: 2.0.4 => 2.0.4
npmGlobalPackages:
create-react-app: 2.0.2
Steps to Reproduce
- Install VS Code 1.27.2 or 1.26.1
npx create-react-app debug-cra2
- Add recommended Debug CRA Tests snippet to
.vscode/launch.json
- Add the snippet below to
src/App.test.js
- Set breakpoint on line 13
console.log({ foo })
- Hit
F5
and debug
Snippet for App.test.js
it('should find the breakpoint', () => {
const foo = 'bar'
console.log({ foo })
expect(foo).toBe('bar')
})
it('should find the other breakpoint', () => {
const foo = 'bar'
console.log({ foo })
expect(foo).toBe('bar')
})
Expected Behavior
Execution stops on line 13
Actual Behavior
Execution stops on line 6 or 7, it’s inconsistent.
Reproducible Demo
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:55 (19 by maintainers)
Top Results From Across the Web
Debugging in Visual Studio Code
One of the great things in Visual Studio Code is debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >Visual Studio Code breakpoint appearing in wrong place
Breakpoints in VSCode were "jumpy" in all my source files. ... My first naive attempt at a debug configuration looked like this:
Read more >Debug ASP.NET Core Blazor WebAssembly - Microsoft Learn
Hit breakpoints during app startup before the debug proxy is running. ... Configure Visual Studio to launch the browser with the user's ...
Read more >Manual: Debug C# code in Unity
This is the recommended way to set up Visual Studio for debugging with Unity. ... Breakpoints allow you to specify points in your...
Read more >VS Code tips — Inline breakpoints - YouTube
Today's VS Code tip: inline breakpointsUse inline breakpoints to break at a specific expression on a line.Potential inline breakpoint ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the solution! For me
disableOptimisticBPs: true
alone did the trick.Has solved the problem for me !