Skip to content

Preview extension not loading #1721

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
dsolodow opened this issue Jan 24, 2019 · 19 comments · Fixed by #1728
Closed

Preview extension not loading #1721

dsolodow opened this issue Jan 24, 2019 · 19 comments · Fixed by #1728
Labels
Issue-Bug A bug to squash.

Comments

@dsolodow
Copy link
Contributor

System Details

### VSCode version: 1.30.2 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8 x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


### PSES version:

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.18317.1000
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18317.1000
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

I am experiencing a problem with getting the preview extension to load, after disabling the release extension

Expected Behaviour

Extension should load; be able to open the Integrated Console, access PowerShell options from the command pallet; etc.

Actual Behaviour

command 'PowerShell.OpenLogFolder' not found
command 'PowerShell.ShowSessionConsole' not found
command 'PowerShell.RestartSession' not found

Attached Logs

Logs never generate. 👎

@rkeithhill
Copy link
Contributor

rkeithhill commented Jan 24, 2019

Have you disabled the non-preview version of the PowerShell extension? Sorry, looks like you disable the non-preview extension. Reloading VSCode doesn't help?

@dsolodow
Copy link
Contributor Author

dsolodow commented Jan 24, 2019 via email

@TylerLeonhardt
Copy link
Member

Odd... Random question... Did you open a folder with vscode or just a blank instance?

@dsolodow
Copy link
Contributor Author

dsolodow commented Jan 24, 2019 via email

@andrewtchilds
Copy link

andrewtchilds commented Jan 24, 2019

Having the same problem (on both my home and work machines), and it only seems to happen if I'm not working within a folder (workspace?) in VS Code.

@SeeminglyScience
Copy link
Collaborator

Same thing for me when in an untitled workspace. It's almost like the activation event doesn't get sent, but the extension host log does indeed show it.

[2019-01-24 09:26:14.884] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.PowerShell-Preview {"startup":false,"activationEvent":"onLanguage:powershell"}
[2019-01-24 09:26:14.884] [exthost] [info] ExtensionService#loadCommonJSModule C:\Users\user\.vscode\extensions\ms-vscode.powershell-preview-2.0.0\out\src\main

@TylerLeonhardt
Copy link
Member

So strange... I wonder if this has something to do with the extension name being "PowerShell Preview" I'll run some tests.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Jan 24, 2019

I can repro this with a CI build that isn't marked "Preview" as well.

@alexandair
Copy link

Another confirmation. Opening a new file, doesn't trigger loading of the preview extension. If I load a folder, and then open a .ps1 file, preview extension is loaded as expected.

@dsolodow
Copy link
Contributor Author

Interesting note; it works fine on my work PC.

### VSCode version: 1.30.2 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8 x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


### PSES version: 2.0.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.17763.134
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.134
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

@jeremytbrun
Copy link

      Another confirmation. Opening a new file, doesn't trigger loading of the preview extension. If I load a folder, and then open a .ps1 file, preview extension is loaded as expected.

Same here.

@TylerLeonhardt
Copy link
Member

I've figured this out and have a fix for it. Will submit a PR soon.

@TylerLeonhardt
Copy link
Member

PR here ^ for those interested in testing it out. You can grab a CI build here:

https://ci.appveyor.com/project/PowerShell/vscode-powershell/builds/21895485/artifacts

Let me know if that fixes it for you 😄

@dsolodow
Copy link
Contributor Author

The CI build is working for me.
Only oddity is that it looks to have replaced/upgraded the "stable" extension version rather than the preview one.

@TylerLeonhardt
Copy link
Member

Yeah that was intentional. Ignore that.

@corbob
Copy link
Contributor

corbob commented Jan 29, 2019

I imagine this is related, so I'll post it here:

When building master, I was getting the message "Activating extension 'ms-vscode.PowerShell' failed: Cannot read property 'toLowerCase' of undefined." pop up. When I loaded a workspace then it loaded without problem.

Activating extension 'ms-vscode.PowerShell' failed: Cannot read property 'toLowerCase' of undefined.

Based on this line: https://github.com/PowerShell/vscode-powershell/pull/1728/files#diff-8cfead41d88ad47d44509a8ab0a109adR163 I'll leave this here as related. If it's not related let me know and I'll open a new issue.

@rkeithhill
Copy link
Contributor

rkeithhill commented Jan 29, 2019

Hmm, if this is indeed the spot where this error originates then it seems that for some reason context.extensionPath is also returning undefined.

@TylerLeonhardt
Copy link
Member

In local testing I confirmed that context.extensionPath wasn't null... But that's my machine ™...

I suppose we can have a default if it IS null... Or I might just do this work: microsoft/vscode#66515 (comment)

@TylerLeonhardt
Copy link
Member

I updated #1728 to have a default of __dirname if all else fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants