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 activation fails as env is null when restoring VSCode #14632

Closed
octref opened this issue Oct 28, 2016 · 9 comments
Closed

Extension activation fails as env is null when restoring VSCode #14632

octref opened this issue Oct 28, 2016 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions important Issue identified as high-priority verified Verification succeeded
Milestone

Comments

@octref
Copy link
Contributor

octref commented Oct 28, 2016

  • VSCode Version: Insider
  • OS Version: OS X 10.11.6

Today I noticed language extensions like https://github.com/Dart-Code/Dart-Code and https://github.com/DonJayamanne/pythonVSCode failed to activate.

Both fails as env is null when being activated. Dart for example:

image

The line in trouble:
(Put a log, will use it soon in gif)

image

This is in the beginning of that file:

image

Now, if I go to a Dart project and open a dart file, the Dart extension will activate correctly. However, if I leave an open tab, and restart VSCode, so it restores the tab, Dart extension fails to activate, as env is null.

bug

Also happened to @roblourens

I'll be available tonight. Let me know how can I help if you can't repro.

@octref octref added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority extensions Issues concerning extensions labels Oct 28, 2016
@kieferrm kieferrm added the candidate Issue identified as probable candidate for fixing in the next release label Oct 28, 2016
@kieferrm kieferrm added this to the October 2016 milestone Oct 28, 2016
@kieferrm
Copy link
Member

This seems related to 2f8c5c1.

@octref
Copy link
Contributor Author

octref commented Oct 28, 2016

Downloaded older Insider builds:

It's somewhere in here I believe: @alexandrudima

image

@octref octref assigned alexdima and unassigned joaomoreno and alexdima Oct 28, 2016
@jrieken jrieken self-assigned this Oct 28, 2016
@jrieken
Copy link
Member

jrieken commented Oct 28, 2016

I'd say this is caused by this line of code. We have it since a long time but my assumption is that recent changes in the extension startup sequence is now triggering this...

@jrieken
Copy link
Member

jrieken commented Oct 28, 2016

To verify: Write an extension that activates on start up (* activation event) with the code below. Start, restart a few times and make sure it never prints errors on the console, but the env object

import * as vscode from 'vscode';
console.log(vscode.env);

@bpasero
Copy link
Member

bpasero commented Oct 28, 2016

@jrieken I am seeing a new error popping up when doing so:

TypeError: Cannot read property 'machineId' of undefined

image

Related to: 31d39b0

@bpasero bpasero reopened this Oct 28, 2016
@bpasero
Copy link
Member

bpasero commented Oct 28, 2016

@jrieken works fine when calling from within the activate method, just not when called outside.

I cannot reproduce this from Code stable when I log env right after the vscode import.

@bpasero bpasero added the verification-found Issue verification failed label Oct 28, 2016
@jrieken
Copy link
Member

jrieken commented Oct 28, 2016

@bpasero You are not on latest! There the variable is called initTelemetryInfo. Please verify this with a later build.

screen shot 2016-10-28 at 12 31 16

@bpasero
Copy link
Member

bpasero commented Oct 28, 2016

@jrieken ah ok sorry.

@bpasero
Copy link
Member

bpasero commented Oct 28, 2016

Verified on Mac this works 👍

@bpasero bpasero closed this as completed Oct 28, 2016
@bpasero bpasero added verified Verification succeeded and removed verification-found Issue verification failed labels Oct 28, 2016
@bpasero bpasero removed the candidate Issue identified as probable candidate for fixing in the next release label Nov 1, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants