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 activate due to dependency to "natives" module #47569

Closed
bpasero opened this issue Apr 10, 2018 · 9 comments
Closed

Extension fails to activate due to dependency to "natives" module #47569

bpasero opened this issue Apr 10, 2018 · 9 comments
Assignees

Comments

@bpasero
Copy link
Member

bpasero commented Apr 10, 2018

image

Extensions in VS Code are running in a node.js process. When we update to version 8.x of node.js, the node module "natives" is no longer supported by node.js. It actually never was officially supported but with node.js 8.x using this module can result in a crash that brings down the entire extension host.

As such, VS Code will prevent loading this module.

If you see an extension failing due to this, please reach out to the extension author and ask to update the dependencies so that the "natives" module is no longer required. You can find the contact details of an extension in the right sidebar of the marketplace:

image

@microsoft microsoft locked and limited conversation to collaborators Apr 10, 2018
@microsoft microsoft unlocked this conversation Apr 10, 2018
PKRoma pushed a commit to PKRoma/vscode that referenced this issue Apr 10, 2018
bpasero added a commit that referenced this issue Apr 13, 2018
* Update to Electron 2.0.0-beta.7

* bump to electron 2.0.0-beta.7

* localStorage - workaround birthtime rounding issues that clear workspace storage

* fix compile error

* workaround #47569

* localStorage - add telemetry for successful migration

* increment to localStorageTimers4

* localStorage - allow to restore from backup if starting with 1.7.x again

* logLocalStorageMigrationStatus only on insider

* back to official distro

* 💄

* still use exploration distro

* remove GTK3 emoji picker which does not seem to work

* 💄
@eamodio
Copy link
Contributor

eamodio commented Apr 14, 2018

I'm seeing this with Live Share when running vscode from source, although I don't with the latest insiders

@Tyriar
Copy link
Member

Tyriar commented Apr 14, 2018

@eamodio we pushed electron v2 back so it will be in Insiders on Monday. I think Live Share will have a fix out soon.

@bpasero bpasero added this to the On Deck milestone Apr 16, 2018
@brettcannon
Copy link
Member

In case any other extension authors suddenly bump into this (FYI I didn't get a message but had to go digging into Developer Tools to discover this issue), you can find out what's pulling in natives with npm ls natives.

@bpasero
Copy link
Member Author

bpasero commented Apr 17, 2018

@Tyriar I noticed this too, I think we do not show the nice notification message for disabling natives module unless you run out of sources where we are more verbose.

@bpasero
Copy link
Member Author

bpasero commented Jun 9, 2018

Closing, we have a workaround in place.

@mattgaspar
Copy link

mattgaspar commented Jul 6, 2018

FYI - This error just started for me after updating to VS Code 1.25 (released today)
I had a custom, unpublished extension and did not receive the notification shown in the image above.
I just got a message about the extension not being valid for the keybinding. Only after going to Developer Tools did I see the message and link to this page.
In the end I needed to update the gulp dependency to 4.0

-- gulp@3.9.1
-- vinyl-fs@0.3.14
-- graceful-fs@3.0.11
-- natives@1.1.0
(from running: npm ls natives)

@ArthurMa1978
Copy link
Member

ArthurMa1978 commented Jul 12, 2018

We got same issue once updating to 1.25 because our extension depends on the unzip module which relies on the natives module

vscode-iot-workbench@0.1.6
-- unzip@0.1.11
-- fstream@0.1.31
-- graceful-fs@3.0.11
-- natives@1.1.3
(from running: npm ls natives)

@ArthurMa1978
Copy link
Member

We fixed our extension by replacing the unzip module with adm-zip.
Just wondering how can we avoid this kind of breaking change? Too many changes / rollbacks in the insider version, hard to capture all breaking changes.

@Tyriar
Copy link
Member

Tyriar commented Jul 14, 2018

@ArthurMa1978 if I remember correctly this module reached into node internals, so when we updated Electron (and node), it broke as the internals of node changed. It's really just unfortunately that this natives module existed in the first place and got depended upon by so many projects, nothing we could have done to prevent it if we wanted to keep updating Electron

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants