Vscode: VS Code fails to start/open when offline

Created on 12 Jun 2016  ยท  176Comments  ยท  Source: microsoft/vscode

  • VSCode Version: 1.2.0
  • OS Version: Windows 8

Steps to Reproduce:

  1. Install VS Code 1.2.0 and open first time while connected to internet
  2. Turn off data connection
  3. Try to restart VS Code (it does not open at all, either from shortcuts or exe)
electron upstream

Most helpful comment

Closing this issue given that we plan to release VSCode stable early February with Electron 3.x. If you want to benefit from the fix already, consider to use our insiders version that already contains the fix: https://code.visualstudio.com/insiders/

All 176 comments

@johnnyPescarul any output when you try to run code --verbose from the command line in this case?

@bpasero Sorry for the late reply, I didn't see the notification. I tried running "code --verbose" from command line and still nothing, not even one line. As soon as I connect to the internet, it works. I tried re-installing multiple times but I have the same behavior. I tried to replicate on a Windows 7 machine, but was not able to (so it seems to be limited to my Windows 8 machine).

@johnnyPescarul does it return immediately when running "code --verbose"?

@bpasero when I run it, it starts the process but it then hangs. It must be something early on since nothing is displayed with verbose flag on. Are there any logs generated?

@johnnyPescarul any chance you could find out all the processes that we are able to spawn? this might get us closer to see where it hangs.

@joaomoreno could this be an issue with creating a connection to the shared process if you are offline?

@bpasero Why the shared process? The window doesn't even seem to open...

@joaomoreno the shared process (to my understanding) gets created from the main side. we have seen super funky behaviour when sending telemetry where the entire VM stops in some DNS lookup. Maybe the main side stops in a similar situation trying to establish a connection to the shared process.

Very unlikely. The main process doesn't even connect to it, simply spawns it. It would only block if fork blocks... and even then the user would read '### VSCode main.js ###' in his console.

I tried again to see if any processes are actually started, but no VSCode process is being started at all, when trying to start in offline mode. Unfortunately I don't have another Windows 8 machine to try and see if I can replicate the issue.

@johnnyPescarul can you run code --version and see output?

@bpasero it is version 1.2.0
Again, if the laptop is offline, the code --version doesn't even work (nothing is displayed).

Wow, that seems to indicate a problem with Electron unless I am mistaken because we use Electron as node, correct @joaomoreno @Tyriar ?

code --version is one of the first things that is checked. Literally the CLI process parses args and checks help and version in an ELectron process where ATOM_SHELL_INTERNAL_RUN_AS_NODE=1.

Here is code.cmd:

@echo off
setlocal
set VSCODE_DEV=
set ATOM_SHELL_INTERNAL_RUN_AS_NODE=1
call "%~dp0..\@@NAME@@.exe" "%~dp0..\resources\\app\\out\\cli.js" %*
endlocal

Which calls into cli.ts:

export function main(args: string[]): TPromise<void> {
    const argv = parseArgs(args);

    if (argv.help) {
        console.log(helpMessage);
    } else if (argv.version) {
        console.log(pkg.version);
    } else ...other cases...

    return TPromise.as(null);
}

main(process.argv.slice(2))
    .then(() => process.exit(0))
    .then(null, err => {
        console.error(err.stack ? err.stack : err);
        process.exit(1);
    });

I have noticed this problem as well. Opening two visual studio code instances by running code --verbose twice has resulted in the second instance opening/starting correctly.

Can confirm this exact same behaviour when running on Windows 10.
Putting my laptop in flight mode (as I was on a plane) meant that none of the processes were able to spawn. This means the issue is easily reproducible for me.

Running code --version or code --help while offline returns immediately without any processes spawning:
image

Running either command as soon as I was tethered back on solid ground was fine:
image

Can you try to see if a bare Electron app starts at least? Try with:

I can confirm the same behaviour with the Electron app itself; both versions exhibited the same behaviour.

For reference, I downloaded the following two packages and just tried running electron.exe from a PS window (most similar example I could make to the reported behaviour above):

  • electron-v1.2.6-win32-x64 (latest Win x64 binary)
  • electron-v0.37.6-win32-x64 (Win x64 binary)

Thanks for helping me/us narrow it down so quickly!
Shall we make an issue on electron? I couldn't find anything in their issues list so far.
UPDATE: I found the following issue on the Atom Shell forum.

For the moment, might it be worth adding something to the VS Code project documentation so that we don't surprise/disappoint more people trying to use the editor without an internet connection?

@PHeonix25 please report this to https://github.com/atom/electron

Will do, thanks @bpasero.
FYI - after finding this issue on the Atom Shell feedback forum, I also tried to implement one of the final proposed solutions: add the executable to the Windows Firewall rules - with no success - it's definitely a problem with electron. :cry:

Thanks for filing it ๐Ÿ‘

Finally, somebody was able to replicate the issue :) Thanks @PHeonix25 . For me this was a very big issue, because I had set-up a travel laptop with my dev environment, tested everything and was relying on doing a lot of offline work on that laptop. Unfortunately when I tried to use it offline I realized it was not working, and at that time I had no option to connect and download a different IDE. Thanks anyway for the great work on VSC.

No worries @johnnyPescarul - keep an eye on the other issue for updates.
I was in the same situation - and it was a very frustrating 14hr flight.

I can also confirm this bug. I opened same issue here (https://github.com/Microsoft/vscode/issues/11228).
Sorry for this i was not aware of this.

VSCode Version: Code 1.4.0 (6276dcb, 2016-08-04T16:45:31.680Z)
OS Version: Windows_NT ia32 10.0.10586

Version 1.6.1 takes very long time to start up. I guess the reasons are:

  • My Internet connection is slow.
  • It tries to connect to some server side on startup.

After I turned off Internet connection, killed the process, then started it again, it started immediately.

It would be great if you add new flag --offline, to run VSC in offline mode.

Does not reproduce for me anymore using 1.8. Please comment if you still see it.

Still seems to happen on Windows 2012 Server at least.

I'm also having this issue but i'm using a windows 7 machine. Nothing appeared when i try to launch vscode while offline (tried both 1.8 and 1.9). But then i tried to run using cygwin, still nothing, but it prints out this message.

$ code
C:\Program Files\Microsoft VS Code\Code.exe: c:\jenkins\workspace\electron-win-ia32\vendor\node\src\cares_wrap.cc:1327: Assertion `(r) == (0)' failed.

I hope this could be a help somehow.

I was digging back into #18507 today and stumbled across #17097 which also applies to my scenario (specifically single core VM). Its possible it may not be the fact that we are offline but rather the VM?

CONFIRMED SOLUTION -- We added another core to our existing VM and the CPU issues disappeared for both Visual Studio Code and Atom (Both of which rely on Electron). At this point I believe this is actually electron issue electron/electron#7839.

I found a way.make ad-hoc network with this code:
Netsh wlan set hostednetwork mode=allow ssid=myexssid key=myexpass
and start network with Netsh wlan start hostednetwork then open VSCode.after open VSCode you can close connection with this code Netsh wlan stop hostednetwork

Sorry to bother but I have to reproduce 'cause I have a lot of time without internet connection. I have no choice but uninstall VSC and I don't know whether I'll restart using it even though the bug has fixed. This is my issue #23519.

I also have the same issue. Repro information
Procmon shows code.exe is running, it's accessing a lot of networking reg keys and files.

Like the first post, running code --version shows nothing if not connected to the internet.

I do have additional Network interfaces due to having HyperV internal networks so that _may_ be confusing Code...

C:\Source> code --version
1.11.1
d9484d12b38879b7f4cdd1150efeb2fd2c1fbf39

Windows 10 (14393.953)

@glennsarti does it still happen with 1.12?

@bpasero I'll try first thing tomorrow morning.

@bpasero Apologies for not updating this issue. Confirmed this issue is not present on 1.12.0. Just tested again on 1.12.2 and all good.

I'm happy to close this issue.

Sorry to report but I'm getting this on 1.13.1 (a higher version than mentioned as fixed above). Literally can toggle flight mode and repro.
image

Hi everyone,

I'm afraid but I can confirm that even the latest version of VSCode has this problem. I noticed/reproduced today while I was tempting to code during a flight:

โžœ  bin ./code --verbose
[72917:0708/140203.395630:WARNING:dns_config_service_posix.cc(152)] dns_config has unhandled options!
[main 14:02:03] Sending env to running instance...
[main 14:02:03] Sent env to running instance. Terminating...

I must add that after this happened, now I'm connected to Internet and the application keeps crashing. I've made sure any instance had been killed from "Activity Monitor" under OSX. What else should I try?

The same issue is also occurring on my vs code
version 1.15
os: windows 10

image

Getting this too on the latest Code _and_ Atom. Must be an Electron issue.

Has this problem been resolved? It happened on my laptop with win10 and the latest vscode1.17.0 (both x64) a few days ago. I am finally able to start vscode when I have internet connection today.

I can confirm that the issue has been resolved immediately after the 1.17.0 update on my windows 10 laptop. Thank You to the Developer for resolving the issue :)

@abhikudo Hi, I just tried to start VSCode offline, and it still failed. It started normally when I reconnected to the Internet. Can you help me with this? My VSCode version is indeed 1.17.0. See the following two images for my VSCode and system details (The OS is Windows 10 home Edition).
image
image

This seems to happen again...

I tried to reproduce this on my Surface Book when I enable flight mode and I cannot. So it is not just the fact that there is no internet connection, there must be more. I still have not figured out what this "more" actually could be...

I had a similar issue with my own electron app; when I didn't have an internet connection but did had a connected adapter (I had some bridged and some virtual network adapters) it didn't really work.

Maybe some can confirm they have virtual network adapters? Might be an Hyper-V one, Virtual-Box or just some loopback adapter?

How to run VS code in offline mode when i am connected to internet? When i open git cloned folder in VS code, I dont want VS code to connect git server.

I encountered the same problem, the first suggested that dns not equipped, I configured dns, even the clues are gone, cpu consistent 99%

one๏ผš
20171205142858

two๏ผš
28

I'm currently having the same issue. VSC fails to launch without internet. My version is 1.19.1 so it's the latest as at the time of writing. I even updated to 1.20.0 - Insider but it was the same thing.

I had the same problem I could not boot vscode without internet, I use windows 10, it came out to update actualize windows and then I could run vscode without internet, now the problem has returned, I do not know what to do, if someone has the solution could help us There are many of us who have this problem.

I was facing this issue earlier but it was resolved after the 1.17.0 update . I thought it must have been resolved by the developers (however I see since you guys are still facing this issue it wasn't).
Although I don't know what actually solved the issue, in my case VS Code failed to launch whenever I wasn't connected to a network (not internet per se). So I used to connect to any open WIFI or make a hotspot from my mobile just to launch it once(No problem in running VS Code once WIFI was disconnected , WIFI was needed for launch only).
I know it is not a solution, but it is a temporary thing you can try until your problems are resolved.
Cheers

Hello abhikudo, I have the problem with my desktop, I do not have Internet access at the moment, and this happens to me not to start the vscode, I have a solution, friend, I like vscode, but this error I have not seen it in other editors like atom or sublime. I have tried formatting but nothing, I do not know what to do to fix it. Is it a problem in the operating system or the editor itself? I was thinking about switching to ubuntu use windows 10 home currently

I found some similar issues when debugging PowerShell scripts using VSCode while being offline. It would just get stuck trying to start PowerShell. To work around it, I created a loopback adapter by following instructions here: https://technet.microsoft.com/en-gb/library/cc708322(v=ws.10).aspx. It seemed to resolve my issue but it's just a workaround and not a fix.

Is there a working solution for this issue?

I tried installing it on server 2012 r2, but CPU usage spikes up to 100% immediately (shared by two code processes).

I followed https://blogs.technet.microsoft.com/pstips/2018/01/14/using-vscode-and-the-powershell-extension-in-an-offline-environment/ and installed the vsix manually as detailed there. Still no change.

`C:\Windows\system32>code --verbose

[main 12:02:25 PM] Starting VS Code
[main 12:02:25 PM] from: c:\Program Files\Microsoft VS Code\resources\app
[main 12:02:25 PM] args: { _: [],
help: false,
h: false,
version: false,
v: false,
wait: false,
w: false,
diff: false,
d: false,
add: false,
a: false,
goto: false,
g: false,
'new-window': false,
n: false,
'unity-launch': false,
'reuse-window': false,
r: false,
'open-url': false,
performance: false,
p: false,
'prof-startup': false,
verbose: true,
logExtensionHostCommunication: false,
'disable-extensions': false,
disableExtensions: false,
'list-extensions': false,
'show-versions': false,
nolazy: false,
'skip-getting-started': false,
'sticky-quickopen': false,
'disable-telemetry': false,
'disable-updates': false,
'disable-crash-reporter': false,
'skip-add-to-recently-opened': false,
status: false,
s: false }
[main 12:02:25 PM] Resolving machine identifier...
[main 12:02:25 PM] Resolved machine identifier: 96f47d1febe5251ec1e036691c4958eb
2aefe6f6dc9f4aa6839c79f8bef1a9a9
[5052:0201/120228.884:INFO:CONSOLE(1225)] "%cTRACE", source: file:///C:/Program
Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1225)
[main 12:02:29 PM] IPC#vscode-workbenchLoaded
[5052:0201/120234.133:INFO:CONSOLE(1226)] "%c ERR", source: file:///C:/Program
Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js (1226)
[5052:0201/120234.133:INFO:CONSOLE(249)] "%c[Extension Host] %crejected promise
not handled within 1 second %c(at Timeout._onTimeout (c:\Program Files\Microsoft
VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:534:327))",
source: file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workben
ch/workbench.main.js (249)
WARNING: Promise with no error callback:8
{ exception: Error: net::ERR_CONNECTION_TIMED_OUT,
error: null,
promise:
{ _creator: null,
_nextState: null,
_state:
{ name: 'error',
enter: [Function: enter],
cancel: [Function: s],
done: null,
then: null,
_completed: [Function: s],
_error: [Function: s],
_notify: [Function: g],
_progress: [Function: s],
_setCompleteValue: [Function: s],
_setErrorValue: [Function: s] },
_listeners: null,
_value: Error: net::ERR_CONNECTION_TIMED_OUT,
_isException: true,
_errorId: 8,
done: [Function: done],
then: [Function: then] },
handler: undefined,
id: 8,
parent: undefined }
Error: net::ERR_CONNECTION_TIMED_OUT
D_OUT

Error: net::ERR_CONNECTION_TIMED_OUT
[main 12:03:19 PM] Error: net::ERR_CONNECTION_TIMED_OUT

Error: net::ERR_CONNECTION_TIMED_OUT
at Timeout._onTimeout (C:\Program Files\Microsoft VS Code\resources\app\out\
vs\code\electron-main\main.js:88:972)
at ontimeout (timers.js:386:14)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)`

I have this issue: 30 march 2018
Version 1.21.1
Commit 79b44aa704ce542d8ca4a3cc44cfca566e7720f1
Date 2018-03-14T14:46:47.128Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Hi Folks,
I've just encountered the same issue. While I lost my internet connection, my VSCode cannot be started.
I tried to run code --verbose and resulting:
vscode_error
And here is my VSCode version:
vscode_version

If anyone has already the permanent solution, please share.
Thanks.

To work around it, I created a loopback adapter by following instructions here: https://technet.microsoft.com/en-gb/library/cc708322(v=ws.10).aspx. It seemed to resolve my issue but it's just a workaround and not a fix.

same problem with windows 7 without internet.

  1. download VSCode-win32-x64-1.22.2.zip from https://vscode.cdn.azure.cn/stable/3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9/VSCode-win32-x64-1.22.2.zip
  2. extract to another computer without internet connection. unzip to c:\vscode\VSCode-win32-x64
  3. run taskmgr, double click code.exe, it appeared in taskmgr but disappeared quickly
  4. try cmd
    cd c:\vscode\VSCode-win32-x64
    code
    the output is:
    net.js:10
    const cares = process.binding('cares_wrap');
    ^

Error: EFILE
at net.js:10:23
at net.js:1645:3
at NativeModule.compile (bootstrap_node.js:535:7)
at NativeModule.require (bootstrap_node.js:475:18)
at internal/child_process.js:6:13
at internal/child_process.js:903:3
at NativeModule.compile (bootstrap_node.js:535:7)
at NativeModule.require (bootstrap_node.js:475:18)
at child_process.js:12:23
at child_process.js:542:3

code --verbose
same output as code at above ( net.js:10 ......)

Same problem on lubuntu 18.04.

$ js -v
v8.10.0
$ code -v
1.23.1
d0182c3417d225529c6d5ad24b7572815d0de9ac
x64

Also facing the same on Windows 10

1.23.1
d0182c3417d225529c6d5ad24b7572815d0de9ac
ia32

It also fails when i try to create a new terminal

Same here on Windows 10

image

Version 1.23.1 Commit d0182c3417d225529c6d5ad24b7572815d0de9ac Date 2018-05-10T17:11:17.614Z Shell 1.7.12 Renderer 58.0.3029.110 Node 7.9.0 Architecture x64

Is there any work being done here. I can successfully replicate and I am willing to provide any needed info.
Exact same error code:

C:\Program Files\Microsoft VS Code>code

C:\Program Files\Microsoft VS Code>
net.js:10
const cares = process.binding('cares_wrap');
                      ^

Error: EFILE
    at net.js:10:23
    at net.js:1645:3
    at NativeModule.compile (bootstrap_node.js:535:7)
    at NativeModule.require (bootstrap_node.js:475:18)
    at internal/child_process.js:6:13
    at internal/child_process.js:903:3
    at NativeModule.compile (bootstrap_node.js:535:7)
    at NativeModule.require (bootstrap_node.js:475:18)
    at child_process.js:12:23
    at child_process.js:542:3

This is on Windows 10 1804. If I bring up my wifi (tether to my phone, for example, with no internet connection on the phone -eg on a plane, as it just happened-) then it works ok.
Using version 1.23.1 as above.

Same problem as above. Adding MS loopback adapter solved the problem

Same problem and output as @garci66 on Windows x64 Family Edition. I found bug report #43864 before this one. I tried to shutdown windows with fast startup disabled and it fixed the problem.

A one time shutdown without fast startup can be done by maintaining the shift key pressed while clicking on the power button of the windows menu, then on the "Shut down" entry. Also see Fast Startup - How to disable if it's causing problems, on Microsoft support forum.

Same here on Windows 10 x64. I thought this was an Windows Insider build issue.

VSC won't launch unless it's connected to a network, with or without internet connectivity.

You can work around it by creating a loopback adapter. See my previous comment.

Yes.. but it should not be needed. Its a code editor! (I know the bug is
with node.js and not specific to VScode, but still, totally unacceptable
from an end user POV)

On Sat, Aug 18, 2018 at 8:21 PM Mark Gossa notifications@github.com wrote:

You can work around it by creating a loopback adapter. See my previous
comment.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/7570#issuecomment-414092135,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKFd2IkkwdJEP94slxU4U9Q4lj_32cOYks5uSKFigaJpZM4Izs0E
.

So much for coding on airplanes... ๐Ÿ˜„

image

Thats how I ended up discovering this bug myself. Had to put my phone in
tethering mode.. connect, launch VScode and then disconnect.

On Mon, Aug 20, 2018 at 10:59 PM Caio Proiete notifications@github.com
wrote:

So much for coding on airplanes... ๐Ÿ˜„

[image: image]
https://user-images.githubusercontent.com/177608/44375778-b2360080-a4cb-11e8-8628-a4344f3d8458.png

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/7570#issuecomment-414524478,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKFd2Ku45snFbgIFsxPSwUIa1rrNROo_ks5uS2llgaJpZM4Izs0E
.

Seems to be an issue with NodeJS prior to 9.x

https://github.com/nodejs/help/issues/948#issuecomment-341918738

@herrjemand I installed NodeJS 9.0.0 as well as 10.9.0 but still the same error as the other people who ran code --verbose

As @reddvid has pointed out

Same here on Windows 10 x64. I thought this was an Windows Insider build issue.

This problem started for me on Windows Insider, so I thought it would be that as well. But other people experience it on Windows 8 as well, so I'm at a loss here on what to do to fix it.
The loopback adapter fixes it for me and works great.

Windows 10 Pro x64 bit
Build 17744.1001
Node  9.0.0 & 10.9.0

Visual Studio Code
1.26.1
493869ee8e8a846b0855873886fc79d480d342de
x64

cmd_2018-08-24_09-11-27
2018-08-24_08-59-02

VS Code 1.27.1 x64 also failures on my laptop if no Wifi is connected. My laptop is Windows 10 Education x64, Insider Version 1809 (build 17758.1).

both code --verbose and code --version print:

dns.js:246
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:246:20)
    at dns.js:377:25
    at dns.js:431:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at net.js:45:13
    at net.js:1730:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at internal/child_process.js:6:13

We are building exploration builds that use a much newer version of Electron (our UI framework). I wonder if this issue reproduces with one of these builds, could you try? Download:

The crash of Resolver in dns.js disappears if my Wi-Fi card is disabled when I use the above exploration version.

Win 10 x64 Edu v1809 b17760.1, VS Code Exploration x64 v1.28.0.

@gdh1995 great to hear, so to verify: you can start without issues using that version and it does not work with our current stable?

Yes, the new one (exp 1.28.0) works both when a Wi-Fi card is disabled and if hardwares enabled but no active Wi-Fi connections.

The current one (1.27.2) can not work:

[Main Instruction]
Visual Studio Code

[Content]

็‰ˆๆœฌ: 1.27.2 (system setup)
ๆไบค: f46c4c469d6e6d8c46f268d1553c5dc4b475840f
ๆ—ฅๆœŸ: 2018-09-12T16:17:45.060Z
Electron: 2.0.7
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
ๆžถๆž„: x64

Great, thanks.

I can confirm the exploration build fixed it for me.
The current latest build still doesn't.

VS Code: 1.27.2 f46c4c469d6e6d8c46f268d1553c5dc4b475840f x64
Node: v10.9.0
Chrome: 69.0.3497.100 (Official Build) (64-bit)
Windows 10 Pro x64 1809 Build 17763.1

@bpasero, hi. Tell me, please, whether this defect is fixed in the last stable version of Electron 3.0 (https://electronjs.org/blog/electron-3-0) or only in beta10 (vscode 1.28.0 based on Electron 3.0.0-beta.10)?

@sashar2 I would assume any version of Electron 3.0.x that is shipping with node.js 10.x

@sashar2 I would assume any version of Electron 3.0.x that is shipping with node.js 10.x

@bpasero, OK, thank you.

Wow, using vs code for the last 3 years but noticed that for the first time yesterday. Internet access has become pretty common. Glad to see it will be fixed soon.

I encountered this problem today. I already had VS Code running and should do a replace in some files. But the sidebar search didn't work. So I tried to open the files that I knew should be modified, but the folders didn't open; the spin icon was just spinning on. So I tried to restart VS Code, but the IDE didn't load.

I will test with the insiders version.

+1 on this report:

C:\Dev\msvc>"C:\Users\billy\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe"

C:\Dev\msvc>
dns.js:246
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:246:20)
    at dns.js:377:25
    at dns.js:431:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at net.js:45:13
    at net.js:1730:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at internal/child_process.js:6:13


C:\Dev\msvc>

Exploration build above seems to fix it for me.

Thank you for unlocking this issue 2 days ago @Microsoft! I work offline a lot and I've finally decided to install an "Exploration Build" of VS Code so I can use VS Code when I'm offline. Could someone please post a link to the most up-to-date stable version of VS Code that works offline? I see these links:

Since those links were posted June 21, I wonder if they are the most up-to-date stable "Exploration Builds" of VS Code. It would be useful if there were a web page that always pointed to the most up-to-date "Exploration Builds."

Thank you.

tell me plz how solve it...........?

i always see duplicate duplicate duplicate duplicate duplicate #7570 #7570 #7570

oky is duplicate but in #7570 where is solution which comment fix it .........?

I have the same issue. version 1.29 with windows 10 1809

The solution so far I've found here is: Use exploration build with electron 3. downloads in the @nancym post before. There is also links in #61787 for a future electron 4 exploration build. (Recomended is electron3 build as stated by @bpasero in #61787#issuecomment-440149592)

Today I had a similar issue but with graphql-playground-electron v1.8.3. It seems that some win10 update has broken something in electron 2.x framework. The exploration version of vscode with electron 3 is working perfectly. Thanks devs!

I faced the same issue today, both vscode stable version and insider version won't launch without a network connection
Thanks for the Loopback adapter workaround, not perfect but it did make my day

Still an issue in the latest version. I used insider and does the same thing. It simply won't run offline.

It's definitely still an issue...

Offline

Offline

With an internet connection

Online

same issue on 1.29.1 was driving me crazy before I realized that it's because of the internet.
also no solution just loops of the bot suggesting duplicates wtf !

guys download the Explorer build up above works fine offline

The solution so far I've found here is: Use exploration build with electron 3. downloads in the @nancym post before. There is also links in #61787 for a future electron 4 exploration build. (Recomended is electron3 build as stated by @bpasero in #61787#issuecomment-440149592)

Exploration works fine to me, too

but in exploration version there are no settings.json to edit your own settings
is there any way for stable build to work offline ??

Was it solved?
I thought it could be some extension, but discarded that idea a long time ago. Apparently, several people also have the same problem here.
error

image
Same error here, we should probably take this to Electron.

Todays VSCode insider release includes Electron 3.0.x, so you can go back from the exploration build to that version.

@AlaaZorkane Apparently, yes, it's Electron. I have the same problem with GitHub desktop app.

I can confirm the new Insider does indeed work offline. Case closed. Thank you

Shouldn't this be brought to the actual release asap? Not running VSCode while offline seems like a big deal...

@bpasero I know that a working build is already available, but I decided to point out something anyway.
My VSCode installation was working just fine until yesterday. I was on 1.29 and windows build 1803. VSCode was working both when online and offline. And then windows decided to update to build 1809 yesterday night and today VSCode stopped working when offline. Once I was online it started working and installed 1.30, which I thought might have included the fix. But it didn't (I know why now, after reading this thread).
I'll get the insider or whichever build for now. This is just for your information, in case you need to take it up with someone at microsoft or something. Because I'm pretty sure the issue was caused by build 1809.

Because I'm pretty sure the issue was caused by build 1809.

Yeah me too.

I had the windows build 1809 even before the failure of my vscode release 1.30. But I agree that some recent update of 1809 was the cause. Also had the offline problem with the electron version of graphql-playground at the same time.

Because I'm pretty sure the issue was caused by build 1809.

Yeah me too.

I can confirm that current stable VSCode 1.30.0 (and prior) on Windows 10 version 1709 (build 16299.785) starts offline without problem.

Version: 1.30.0
Commit: c6e592b2b5770e40a98cb9c2715a8ef89aec3d74
Date: 2018-12-11T22:29:11.253Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.16299

I have stable VSCode 1.30.0 on Windows 10 version 1809 not open when offline.

Same problem on Windows 10 1809 and Visual Studio Code 1.29.1(System setup)

@myfonj Actually, it happens on Linux as well. I do not think it is related to any particular OS.

Same problem on Windows_NT x64 10.0.17763 and Visual Studio Code 1.30.1

I'm also having this same issue with the same command line error message with Windows 10 1809 and VS Code 1.30.1

VS Code 1.30.1 still can't run offline. :(

capture2

me too!๐Ÿ˜‚,[OS Version: 10.0.17763 N/A Build 17763 ; vscode 1.30.1]
image

Can confirm. The issue only comes up in offline.
It doesn't have to be connected to internet. It's like VSCode checks for a network connection to begin.
As long as it's connected to any network (with or without internet/both Ethernet and wifi) it starts.
version 1.30.1 (system setup)

I am having the similar issue as mentioned above please help.
Both VSCode x64 system/user wise installation v1.30.1 unable to open VSCode offline,
Besides when connected to inet , when select " Open with Code " on right click context menu, VSCode opened in two instances for a selected directory rather than single instance.
OS - Winodws 10 build 1809 withe latest updates
vscode_start_issue

Same Issue.
Windows 10, VSC version 1.30.1
Error EFILE when no connection

Same problem latest VS Code, on Windows 10 build 1809

Facing the same issue with windows 10 on the latest version of vs code 1.30. Tried deleting preferences from %appdata%\Code. Resolves the issue temporarily, but after a restart, this error appears again.

Even if delete the cache folder it does not start while offline :( , please VSCode dev, could you guys fix this?

The same problem with VS Code 1.30.1 on Windows 10 Enterprise 1809 LTSC.

Tried in Ubuntu, works fine without connection.
Seems to happen only in windows.

Issue started when i upgraded to win 10 1809

Issue started when i upgraded to win 10 1809

@Dudeonyx I can second that.

Please Microsoft give us a solution, we are stuck here, why this Win10 1809 so annoying these days, without proper QA

same issue

  • Windows 10 1809
$ code --version
1.30.1
dea8705087adb1b5e5ae1d9123278e178656186a
x64

Omg, VSC not work while no have internet..
Microsoft, fix it!!!

And stop update windows 10 with some bugs!!!
I want to go back to windows 7!

shame on you Microsoft!!! Bilions devices used w10 and microsoft update bugs after bugs!!!

just noticed I can also repro while working offline.
code.exe start but immediately quits. this is what I get when starting it from command line

dns.js:246
this._handle = new ChannelWrap();
^ (this was originally pointing at "new")

Error: EFILE
at new Resolver (dns.js:246:20)
at dns.js:377:25
at dns.js:431:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at net.js:45:13
at net.js:1730:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at internal/child_process.js:6:13

looks like the dns resolver is expected regardless of the hosting machine working offline?

I am running on Win 10.0.17763 Build 17763.195, version 1809
VS Code version:

Version: 1.30.1 (system setup)
Commit: dea8705087adb1b5e5ae1d9123278e178656186a
Date: 2018-12-18T18:12:07.165Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41

I can collect further data if it helps

I can not open visual studio code on windows 10 1809 offline:

code --verbose
dns.js:246
this._handle = new ChannelWrap();
^

Error: EFILE
at new Resolver (dns.js:246:20)
at dns.js:377:25
at dns.js:431:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at net.js:45:13
at net.js:1730:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at internal/child_process.js:6:13

code -version
1.30.1
dea8705087adb1b5e5ae1d9123278e178656186a
x64

Same as here can't open VS Code since I updated my laptop :-(

I encountered the same problem in the windows 1809 version :(

Same issue

Version: 1.30.1 (user setup)
Commit: dea8705087adb1b5e5ae1d9123278e178656186a
Date: 2018-12-18T18:12:07.165Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17763

This issue has label fixed-in-electron-3.0.x

Is there a timeline for using electron 3?

Is there a timeline for using electron 3?

https://github.com/Microsoft/vscode/issues/52629#issuecomment-445791322 says in February.

Thank you, @dlech!

encounter this problem too,
os: Windows 1809 (17763.195)
code vision: 1.30.1

run code by command
code
dns.js:246
this._handle = new ChannelWrap();
^

Error: EFILE
at new Resolver (dns.js:246:20)
at dns.js:377:25
at dns.js:431:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at net.js:45:13
at net.js:1730:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at internal/child_process.js:6:13

And I tried code-1.31.0-insider, this can run offline, not encounter the problem.
But I have to set all the settings and download all extensions.
Please give me a choice of the old version to download (to run back)

This looks like the same issue and says one workaround is to add a loopback adapter. What it looks like is happening is that specific Windows version (1809) shuts down DNS when there's no adapter active. Adding the loopback adapter fakes Windows into keeping DNS up. https://discuss.atom.io/t/atom-wont-start-without-internet/60939/6

@PeterJohnson thanks for the findings and information, it worked thank you very much again,theoretically it should work as you mentioned but I want to ask is, by if we add a legacy hardware device Microsoft KM-TEST loopback Adapter any side-effects to the system?

The loopback adapter does not talk to any actual hardware, it's a virtual device. It will show up as a network interface to anything that looks at network interfaces (e.g. it shows up in ipconfig /all), so if you have scripts or programs that pay attention to that it might in rare cases have a side effect. The only other side effect I'm aware of is that if you assign an IP address to it, that IP address might conflict with other networks you connect to, but it seems like for this workaround you don't need to assign an IP.

Same issue here.
Awaiting for MS to solve the problem quick.

Same issue for me too.

Version: 1.30.2 (user setup)
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17763

WORKAROUND
If you have mobile data available, there is a meagre workaround that will consume just several bytes of your data credit.
- Start connection to the Internet
- Start as many instances of vsCode as you need
- Close connection to the Internet
- An arbitrary number of tabs can be opened in a vsCode window
- No new vsCode window can be opened without connection to the Internet

I tried something similar, but when using the latex workshop extension, for instance, the pdf preview of the document won't update.

I encountered this problem after the lasted update yesterday. Seems like the error comes from the auto updater.

I encountered this problem too, and I have to roll back to notepad++ when coding at home

`C:\Users\dingb>code
dns.js:246
this._handle = new ChannelWrap();
^

Error: EFILE
at new Resolver (dns.js:246:20)
at dns.js:377:25
at dns.js:431:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at net.js:45:13
at net.js:1730:3
at NativeModule.compile (bootstrap_node.js:606:7)
at NativeModule.require (bootstrap_node.js:550:18)
at internal/child_process.js:6:13`

Same issue for me too.

Version: 1.30.2 (user setup)
Commit: 61122f8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17763

Same here too. The stranges thing is that the same problem affects Hyper as well as VS Code.

Version: 1.30.2 (user setup)
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17763

I encountered this problem after the lasted update yesterday. Seems like the error comes from the auto updater.

update windows version or vscode version?

Not just VSCode, MongoDB Compass and Postman also affected with this error, this error is caused by the Electron core. Update to Electron 3.0.x or electron@latest (v4.0.1) won't fix the issue.

My hot fix - Windows: Install your own loopback network interface to trick Electron into thinking that you are not offline (as someone mentioned above: Instruction - pingzic.net)
-> If you don't see the option "Add legacy hardware", make sure you have click/tap on "Scan for hardware changes"

It's working now, I don't have a Mac or Linux machine here but this should also works.

Same problem here after updating windows10

still not fix the issue do something ??

i am banging my head to fix this

i am banging my head to fix this

the only solution so far is to enable loopback adapter.
you can find instruction here: https://www.pingzic.net/how-to-enable-loopback-adapter-in-windows-10/

Have the same issuse running win10 offline no internet vscode dont load getting error pointing to dns.js:246
This.handle = new channelwrap()

i am banging my head to fix this

the only solution so far is to enable loopback adapter.
you can find instruction here: https://www.pingzic.net/how-to-enable-loopback-adapter-in-windows-10/

Can this way reduce the network speed or ping? (internet or lan)

i am banging my head to fix this

the only solution so far is to enable loopback adapter.
you can find instruction here: https://www.pingzic.net/how-to-enable-loopback-adapter-in-windows-10/

It worked. Thank you!!!
But it is gonna affect anything over network or pc in a negative way?

i am banging my head to fix this

the only solution so far is to enable loopback adapter.
you can find instruction here: https://www.pingzic.net/how-to-enable-loopback-adapter-in-windows-10/

It worked. Thank you!!!
But it is gonna affect anything over network or pc in a negative way?

Adding a loopback adapter does not affect your computer performance. Some Linux distro itself have a built-in loopback interface.

I tried to downgrade VSCode and Electron but nothing works. I can confirm that the error is caused by upgrading Windows 10 to version 1809.

My college has a captive portal page in which I need to enter my credentials to access the internet.
I tried running VS Code while connected to the wi-fi but not signed in on the captive portal. To my surprise VS Code runs as expected , but as soon as I turn on airplane mode, running code . on cmd throws those dns errors.

I guess this could work as a hint to fix the problem.
On a side note, I have friends who are on the latest windows version (17763.253) and on VS Code 1.30.2 with the same extensions installed, they don't seem to have the same issue.

I also encounter bug as I upgrade my windows 10 from 17134.285 to 17763 ๐Ÿ˜ข.

I also confirm this for Windows 10 1809 Update and VS Code 1.30.2. My first temporary solution is leave VS Code open when disconnecting to the internet. But the loopback adapter works as well.

I also confirm this for Windows 10 1809 Update and VS Code 1.30

Same issue with me.

I'm experiencing the issue as well.
Windows 10 Home 1809 10.0.17763, VS Code 1.30.2

Same for me. I like VSCode but this bug is really annoying.

Same for me,feel so bad

BOOO! NP++ to the rescue

VS Code version

Version: 1.30.2 (user setup)
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17763

code --verbose

dns.js:246
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:246:20)
    at dns.js:377:25
    at dns.js:431:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at net.js:45:13
    at net.js:1730:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at internal/child_process.js:6:13

BOOO! NP++ to the rescue

VS Code version

Version: 1.30.2 (user setup)
Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
Date: 2019-01-07T22:54:13.295Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 10.0.17763

code --verbose

dns.js:246
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:246:20)
    at dns.js:377:25
    at dns.js:431:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at net.js:45:13
    at net.js:1730:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at internal/child_process.js:6:13

same problem here with the exact same resolute

@Emilius449 Thank you for posting the workaround. I would prefer that they just fix it.

Recently i just update my windows 10 to latest insider build 18290 and i see that VS code is working offline on this version so when windows 10 stable version of build will release it'll solve all the problems.

Closing this issue given that we plan to release VSCode stable early February with Electron 3.x. If you want to benefit from the fix already, consider to use our insiders version that already contains the fix: https://code.visualstudio.com/insiders/

I have the same problem I thought something is wrong then I looked into google and it turns out there are many people facing the exact same issue. Please fix it ASAP.

It has been happening for a month now. Before coming to this thread I was seariously looking for alternatives. Please fix it

I think it is the best time to switch to another editor ๐Ÿ˜ก๐Ÿ˜ก๐Ÿ˜ก

Experienced this just yesterday...

C:\Users\Frost\AppData\Local\Programs\Microsoft VS Code>code --help

C:\Users\Frost\AppData\Local\Programs\Microsoft VS Code>
dns.js:246
    this._handle = new ChannelWrap();
                   ^

Error: EFILE
    at new Resolver (dns.js:246:20)
    at dns.js:377:25
    at dns.js:431:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at net.js:45:13
    at net.js:1730:3
    at NativeModule.compile (bootstrap_node.js:606:7)
    at NativeModule.require (bootstrap_node.js:550:18)
    at internal/child_process.js:6:13

My vscode wasn't starting when offline in 2017 and few weeks ago again.
Had same "dns.js:246 this._handle = new ChannelWrap();" crap
Connected to Internet and started vscode and disconnected was fine but then even debugging wasnt working without connection. Reinstalling, deleting Extensions, nothing helped. So i've switched to InsidersBuild wich was working.

Last week i was looking what is eating up all my ssd space and found an directory from code.
VSCode wasnt working anyway so ive deleted anything in these Folders.

C:\Usersxxx\AppData\Roaming\Code\Cache
C:\Usersxxx\AppData\Roaming\Code\CachedData
C:\Usersxxx\AppData\Roaming\Code\CachedExtensions

After starting vscode by mistake and not insiders it started fine without Internet.
Its working now since few Days so ive switched back from Insiders

@PinkiePieStyle
You got it. Deleting content of the three directories worked for me. Nevertheless I recommend to make a copy. One never knows what may go wrong. Remember Murphy's laws ...

tell me how to fix this :(

@narr07 - This is fixed. Upgrade VSC to 1.31 February 2019 release. VSC runs now on Electron 3:

Version: 1.31.0 (system setup)
Commit: 7c66f58312b48ed8ca4e387ebd9ffe9605332caa
Date: 2019-02-05T22:35:56.624Z
Electron: 3.1.2
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17763

I think it is the best time to switch to another editor ๐Ÿ˜ก๐Ÿ˜ก๐Ÿ˜ก

https://github.com/Microsoft/vscode/issues/7570#issuecomment-461230482

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrisdias picture chrisdias  ยท  3Comments

villiv picture villiv  ยท  3Comments

mrkiley picture mrkiley  ยท  3Comments

lukehoban picture lukehoban  ยท  3Comments

philipgiuliani picture philipgiuliani  ยท  3Comments