Skip to content

Hitting F5 "too soon, during startup" yields "Cannot read property 'length' of undefined" #1113

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

Closed
sba923 opened this issue Dec 3, 2017 · 10 comments
Labels
Area-Extension Terminal Issue-Bug A bug to squash. Up for Grabs Will shepherd PRs.

Comments

@sba923
Copy link

sba923 commented Dec 3, 2017

I'm not sure whether the PowerShell extension is the culprit, so I'm not attaching logs... yet.

If I launch Visual Studio code, that will reopen my last edited PowerShell script, and hit F5 "too soon, during startup" I get:

Error: Cannot read property 'length' of undefined

If I wait "long enough", the issue doesn't show up.

@rlyons38
Copy link

rlyons38 commented Dec 3, 2017

Could this not just be loading your powershell profile? Not sure if you have anything specified in there or not, but is my first initial thought.

@virtualninjach
Copy link

seeing this too as well as "Timed out waiting for the PowerShell extension to start." using F5

@sba923
Copy link
Author

sba923 commented Dec 6, 2017

@rlyons38: I'm not sure what you mean by "Could this not just be loading your powershell profile?" Do you mean that hitting F5 while the profile is executing would wreak havoc with that execution?

@lantrix
Copy link

lantrix commented Dec 7, 2017

I get the same thing. I notice it's only during the period that the PowerShell Integrated Console has not finished loading (while ~/.config/powershell/Microsoft.VSCode_profile.ps1 is loading)

@shihanpietersz
Copy link

this issue is still not fixed. not sure why MS is pushing so much to VSCODE when its still a half baked product. I think i might just start using the PS ISE again

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Apr 3, 2018

@shihanpietersz:

The ISE is complete and in maintenance mode - you can use it, depend on it, but know that no new features will be coming.

That said, I'll say this about VSCode... One great thing about VSCode is that it's cross-platform, something the ISE is not. This is fantastic for PowerShell Core, the cross-platform version of PowerShell.

In addition to that, the git integration is sharp, you have access to a plethora of other extensions, and the extension is fixed-forward meaning you're always on the latest version - and we can iterate faster.

The biggest push since the beginning of the extension was getting as close to feature parity with the ISE as possible. I think we're pretty close to that goal so now it's time to shift gears and focus on some performance issues that are showing up.

Now, the reason why this particular issue isn't fixed yet is because it's just not up there on the priority - it's an issue with a simple enough workaround that doesn't block people. That's not to say it shouldn't be fixed (it should!) but we've got X issues and Y engineers where X > Y.

I promise we're going through issues as fast as we can. We're also open source, as you know. If you, or anyone watching, would love to contribute - you can - and invoke positive change to all the users who rely on this extension.

The best thing you can do (besides contributing 😄) is give this issue a 👍 - that's how we triage now.
I'm truly sorry you're frustrated that this isn't fix, but I hope this explanation helps give insight into what's going on.

@TylerLeonhardt
Copy link
Member

All that said, I think this issue might be relatively trivial. I'll have to do some investigation but I think this would be a simple one for a first time contributor. I'm going to mark this as up-for-grabs and give some more context when I get a chance.

@TylerLeonhardt TylerLeonhardt added the Up for Grabs Will shepherd PRs. label Apr 3, 2018
@dee-see
Copy link

dee-see commented Oct 28, 2018

Can anyone still repro this? I wanted to grab it so I put a sleep in my vscode $PROFILE and when I hit F5 "too soon" I get a nice "Cannot debug or run a PowerShell script until the PowerShell session has started. Wait for the PowerShell session to finish starting and try again." message.

I'm on Linux, is it a platform specific issue on Windows?

@PrzemyslawKlys
Copy link
Contributor

This was added as part of #1433

Basically when you started script too fast it would crash. Now it display what you are seeing. Not sure if it's fixed by that thou. I've not seen "Cannot read property 'length' of undefined" for a long while thou. So maybe it is.

@rkeithhill
Copy link
Contributor

As @PrzemyslawKlys mentions, I believe this was fixed via #1433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extension Terminal Issue-Bug A bug to squash. Up for Grabs Will shepherd PRs.
Projects
None yet
Development

No branches or pull requests

9 participants