question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different Preview Behavior for debugging

See original GitHub issue

Issue Description

I am experiencing a problem with… debugging. I set a breakpoint as I would normally do. The code stops.

image

I see what I want to see - I press SHIFT+F5 to stop PowerShell and fix the issues.

In production the code is stopped, and nothing more is happening. In Preview the data that is currently in place seems to flow to terminal.

Normally you should be able to reproduce it with something similar to:

for ($i = 0; $i -lt 10; $i++) {
    'test'
}

After it hits breakpoint, when you do Shift + F5 it will throw everything else into the

image

But while working on this easy to use example I seem to hit #2175 issue all the time. After I run the code, nothing happens (F5 stops working). And after I restart PowerShell

image

And can’t run any code either. I have to close VSCode to be able to work again… however finally I was able to run different code, and again try to build a working example:

$Testor = for ($i = 0; $i -lt 10; $i++) {
    $Tes2 = for ($i = 0; $i -lt 10; $i++) {
        'test'
    }
    $Tes2
    'test'

}
$Testor

image

It will display all tests from Tes2.

But I can pretty much catch #2175 90% of the time using:

for ($i = 0; $i -lt 10; $i++) {
    'test'
}

Sorry for mixing up two problems, but it just came while I was trying to reproduce so maybe related.

Attached Logs

Follow the instructions in the README about capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.17763
VSCode 1.39.2
PowerShell Extension Version 2019.11.1

PowerShell Information

Name Value
PSVersion 5.1.17763.771
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.17763.771
BuildVersion 10.0.17763.771
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
beautify HookyQR 1.5.0
gitlens eamodio 10.1.2
material-icon-theme PKief 3.9.1
open-in-browser techer 2.0.0
powershell-preview ms-vscode 2019.11.1
theme-monokai-pro-vscode monokai 1.1.14
vscode-tldr bmuskalla 1.0.0
vscode-wakatime WakaTime 2.2.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PrzemyslawKlyscommented, Apr 12, 2022

Yes, it no longer acts like that. So I closed it.

1reaction
rjmholtcommented, Dec 4, 2019

launch requests will give you the ability to STOP the code that’s running (spin down a web server, stop a script from continuing, etc) where attach requests typically just detach from the attached process but leave it running.

That makes sense to me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debug Previews | Apple Developer Forums
I tried different stuffs in order to show debugging information at under a Live Preview, but none of them works. The Logger API...
Read more >
A guide to GTM Preview and debug mode -
With GTM Preview and debug mode, you can efficiently uncover errors and unexpected behavior in your setup before it is available for your ......
Read more >
Different event behavior in the preview VS debug layout?
I've set an event that supposed to cause a mosaic piece to start flashing if it is completely uncovered (=doesn't overlap ANY ground...
Read more >
How Dev Tools Can Change Your Code's Behavior
The Observer Effect and Debugging: How Dev Tools Can Change Your Code's Behavior · Selecting Code and Hovering Shows The Result In Chrome ......
Read more >
Tips and tricks in the debugger - Visual Studio - Microsoft Learn
Set Visual Studio debugger options to meet your debugging needs. You can configure break behavior, debugging levels, display behavior, and much ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found