Skip to content
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

Extension fails to start using VSCode Insiders #195

Closed
isc-apino opened this issue Dec 7, 2020 · 7 comments · May be fixed by #197
Closed

Extension fails to start using VSCode Insiders #195

isc-apino opened this issue Dec 7, 2020 · 7 comments · May be fixed by #197
Labels
bug Something isn't working

Comments

@isc-apino
Copy link

Describe the bug:
When running out of VSCode Insiders the extension fails to start. Looking at the Extension Host Log:

[2020-12-07 11:58:43.282] [exthost] [info] ExtensionService#_doActivateExtension mjcrouch.perforce {"startup":true,"extensionId":{"value":"mjcrouch.perforce","_lower":"mjcrouch.perforce"},"activationEvent":"*"}
[2020-12-07 11:58:43.283] [exthost] [info] ExtensionService#loadCommonJSModule file:///Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension
[2020-12-07 11:58:43.292] [exthost] [error] Activating extension mjcrouch.perforce failed due to an error:
[2020-12-07 11:58:43.300] [exthost] [error] Error: [mjcrouch.perforce]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api mjcrouch.perforce
	at a (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:672:99)
	at Object.t.checkProposedApiEnabled (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:672:567)
	at Object.get RemoteAuthorityResolverError [as RemoteAuthorityResolverError] (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1041:451)
	at n (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:2087)
	at Object.<anonymous> (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:2171)
	at i (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:186)
	at Object.<anonymous> (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:62201)
	at i (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:186)
	at Object.<anonymous> (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:80512)
	at i (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:186)
	at Object.<anonymous> (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:7:3002)
	at i (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:186)
	at /Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:985
	at Object.<anonymous> (/Users/apino/.vscode-insiders/extensions/mjcrouch.perforce-4.14.0/dist/extension.js:1:995)
	at Module.o._compile (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/loader.js:16:571)
	at Object.Module._extensions..js (internal/modules/cjs/loader.js:1051:10)
	at Module.load (internal/modules/cjs/loader.js:862:32)
	at Module._load (internal/modules/cjs/loader.js:774:14)
	at Function.Module._load (electron/js2c/asar.js:769:28)
	at Function.t._load (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1093:657)
	at Function.i._load (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1062:106)
	at Function.n._load (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1058:391)
	at Module.require (internal/modules/cjs/loader.js:899:19)
	at require (internal/modules/cjs/helpers.js:74:18)
	at Function.r [as __$__nodeRequire] (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/loader.js:20:263)
	at p._loadCommonJSModule (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:1063:422)
	at p._doActivateExtension (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:958:742)
	at p._activateExtension (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:957:822)
	at processTicksAndRejections (internal/process/task_queues.js:94:5)
	at async Promise.all (index 5)
	at async Promise.all (index 0)

I have tried adding "enable-proposed-api": ["mjcrouch.perforce"] to my argv.json, but the error persists.

Expected behavior:
Extension starts and behaves normally

To Reproduce:
Install perforce extension on VSCode insiders.

Versions & Details:

  • Perforce extension: 4.14.0
  • VSCode version: 1.52.0-insider
  • Operating System: macOS Mojave 10.14.6
  • Perforce server details (if known): N/A
  • Are you using a multi-root workspace?: N/A

Additional context

It'd be really helpful to use this extension in insiders. Some vscode extension development which I want to source control with Perforce has to use insiders. The extension works as expected in my non-insiders version of VSCode.

@isc-apino isc-apino added the bug Something isn't working label Dec 7, 2020
@marcsandusky
Copy link

I experience this under Ubuntu 20.04 as well. Same description in the extension host log when running code-insiders.

@mjcrouch
Copy link
Owner

mjcrouch commented Dec 7, 2020

hmm, this seems strange - the extension doesn't use any proposed APIs and has previously worked fine in insiders. Not sure why this is happening now. Will have a look into it.

@mjcrouch
Copy link
Owner

mjcrouch commented Dec 7, 2020

I suspect it's probably this issue - microsoft/vscode#111913 - I might be able to just compile with a newer typescript version to work around it

@mjcrouch
Copy link
Owner

mjcrouch commented Dec 7, 2020

well, seems like changing the compiler version fixes the issue but breaks a whole load of tests, unfortunately not in a great position to debug this right now and check if they're real failures, so will have to leave it for another day

@mwpenny
Copy link

mwpenny commented Dec 8, 2020

@mjcrouch The tests probably break because in newer versions of TypeScript when you do import * as vscode from "vscode" ("import star"), the compiler will emit the following code:

var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};`

const vscode = __importStar(require("vscode"));

In other words, module properties will have a getter and no setter. If you try to mock them out using a test framework like Jest, you'll get an error. In Jest, I get:

TypeError: Cannot set property myProperty of #<Object> which has only a getter

@mwpenny
Copy link

mwpenny commented Dec 9, 2020

Fixed upstream: microsoft/vscode#112141

@mjcrouch
Copy link
Owner

mjcrouch commented Dec 9, 2020

thanks for the update!

@mjcrouch mjcrouch closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants