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.

Script fails to run on second run

See original GitHub issue

On request of @TylerLeonhardt in #2175 I am creating this as a separate issue.

Description

When breakpoints are set in at least two other open files, the current open file (which does not contain a breakpoint) can only be executed once. Upon a second execution vscode-insders freezes.

Steps to reproduce the issue:

  1. Create 3 files: File1.ps1 contains code with no breakpoint (Ex. Get-Process) File2.ps1 contains code with a breakpoint (Ex. Start-Sleep -Seconds 1, breakpoint line 1) File3.ps1 contains code with a breakpoint (Ex. Start-Sleep -Seconds 1, breakpoint line 1)
  2. When all 3 files are open in the editor pane and File1.ps1 is focused press F5 Notice that Get-Process is executed correctly and all processes are retrieved
  3. Press F5 again and notice that Get-Process is not executed, an orange bar is displayed at the bottom and the debug panel to stop debugging is floating at the top but doesn’t respond to any clicks and stays there. image

Workarounds:

  • Close and reopen vscode-insiders to have one other successful run
  • Remove all breakpoints in all other files

System details

@rjmholt I hope you can simulate this properly now. I’m currently using PowerShell Preview 2019.11.0 and vscode-insiders:

Version: 1.41.0-insider (user setup)
Commit: 4934a6f487b9ed6b99b900ae0710c7b452792e20
Date: 2019-11-20T05:25:39.619Z
Electron: 6.1.4
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 6.2.9200

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
JustinGrotecommented, Nov 26, 2019

@TylerLeonhardt I dumped the artifacts from the build: https://dev.azure.com/powershell/PowerShellEditorServices/_build/results?buildId=39793 into my extensions module folder, and @SeeminglyScience’s fix so far seems to be working for me. I ran it thru about 10-15 times and looking good so far. I’ll stress test it tomorrow during development.

2reactions
TylerLeonhardtcommented, Nov 26, 2019

@SeeminglyScience has a fix out for this. @SeeminglyScience if you wanna provide a test vsix for these folks, feel free to upload one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot run the second script / bash from the first ...
But here come out my problem, if I will try to run it the Python app will run perfectly but the script will...
Read more >
Script fails in second iteration
Vuser init - Launch and Login Action - Search Vuser end - Logout first iteration is working fine. It started throwing error message...
Read more >
Why is my Apple Script not running twice?
Yoru script fails on second runs because you completely b0rk the code :) Consider the following part of your code: on isFolder(folderAlias) set ......
Read more >
Bash - run one script when previous is sucessful else ...
report_failure.sh. How can I do something like this pseudo-code does: if (main_script.sh finished without error): run report_success.
Read more >
How do I run multiple scripts within a script, even if one ...
The problem is, if the first command (or second) dies with an error, none of the subsequent commands are run. Is there a...
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