Vscode: VSCode Insiders Blank Screen

Created on 30 Mar 2017  ·  71Comments  ·  Source: microsoft/vscode

  • VSCode Version: Version 1.11.0-insider (1.11.0-insider) d98a518c5485bd7a47c70f5b3783f70efa5edcd6
  • OS Version: mac Sierra 10.12.2

Steps to Reproduce:

  1. As Of This issues : vscode/issues/2806, Downloaded VS Code From https://code.visualstudio.com/insiders
  2. When I Open VSCode, it comes just Blank , None of the option works
    screen shot 2017-03-30 at 10 29 53 am
important verified

Most helpful comment

Reverted the fix for #21655, will engage on better understanding the underlying issue.

Thanks for all the help guys. We'll get this fix out asap.

All 71 comments

Did you try with the latest update? If you still see this, can you see something in the console or in the developer tools (Help > Toggle Developer Tools)

Downloaded New version : 6b9548065ad3e31fca4f0e91cf882505fe8c30cf

Still seeing the same issue,

I'm able to open developer tools
screen shot 2017-03-30 at 1 33 34 pm

Can you check the Console tab in the dev tools?

Yes, I can see Console tab...

please list me that steps, commands/log files that I can share with u to solve this issue.

@charankumarpalla Please click the 'Console' tab in the 'Developer Tools' window and post what is shown there (or attach a screenshot).

@chrmarti the workaround for me right now is:
OS : Mac OS X Sierra 10.2.4
Code 1.11 Stable

code --verbose

Update:
It looks like if I load Code from terminal it works, but if i don't load it from terminal (e.g. finder) it doesnt work

I do not know if it will be a solution ,,,

What happens when renaming $HOME/Library/Application Support/Code - Insiders directory from Terminal and Invoke code from finder?

Note: $HOME/Library/Application Support/Code - Insiders contains some important files such as settings.json. Do not erase it.

@hrgui @satokaz when this happens can you see if there is some output in the console printed?

image

Unfortunately, there isn't anything in the console:

screen shot 2017-04-05 at 10 13 55 pm

What I also do know in this mode, in 1.10.2, I had this problem with debugger that says the following:

"Cannot find node in path"

Would that be related by any chance?

@hrgui to be clear, you see this blank window only when clicking on the Code icon in the dock, but not when running from the command line?

@bpasero correct. From the command line, it looks like this:
screen shot 2017-04-05 at 10 21 11 pm

@hrgui how about running the binary directly from the command line:

/Applications/Visual Studio Code.app/Contents/MacOS> ./Electron

@bpasero

I am sorry for making you misunderstand.
In my environment code v1.11 and code-insiders 1.11.0 2017-04-04T21:06:37.100Z works fine.

  • VSCode Version: Code 1.11.0 (9122ec4, 2017-04-05T20:52:01.201Z)
  • OS Version: Darwin x64 16.5.0 (macOS sierra 10.12.4)

I encountered similar problems in the past and had experience recovering by deleting directories.

@bpasero that results in the blank screen / nothing in devtools console

@hrgui how about /Applications/Visual Studio Code.app/Contents/MacOS> ./Electron --verbose

Any output in the terminal?

terminal shows:

/Applications/Visual Studio Code.app/Contents/MacOS> ./Electron --verbose
➜  MacOS ./Electron --verbose
[main 10:40:31 PM] Starting VS Code in verbose mode
[main 10:40:31 PM] from: /Applications/Visual Studio Code.app/Contents/Resources/app
[main 10:40:31 PM] args: { _: [],
  help: false,
  h: false,
  version: false,
  v: false,
  wait: false,
  w: false,
  diff: false,
  d: false,
  goto: false,
  g: false,
  'new-window': false,
  n: false,
  'unity-launch': false,
  'reuse-window': false,
  r: 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 }



md5-77bd168ebb9353f1759f7a70350642ab



➜  MacOS code --verbose
[main 10:42:22 PM] Starting VS Code in verbose mode
[main 10:42:22 PM] from: /Applications/Visual Studio Code.app/Contents/Resources/app
[main 10:42:22 PM] args: { _: [],
  help: false,
  h: false,
  version: false,
  v: false,
  wait: false,
  w: false,
  diff: false,
  d: false,
  goto: false,
  g: false,
  'new-window': false,
  n: false,
  'unity-launch': false,
  'reuse-window': false,
  r: 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 }
[main 10:42:23 PM] IPC#vscode-machineId
[89614:0405/224224:INFO:CONSOLE(28)] "Overwriting extension <<.ejs>> to now point to mime <<text/x-ejs>>", source: file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[89614:0405/224224:INFO:CONSOLE(28)] "Overwriting extension <<.jsx>> to now point to mime <<text/x-jsx>>", source: file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[main 10:42:25 PM] IPC#vscode-workbenchLoaded
[89614:0405/224226:INFO:CONSOLE(28)] "%c[IPC Library: Watcher]", source: file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[89614:0405/224226:INFO:CONSOLE(28)] "%c[IPC Library: Watcher]", source: file:////Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)

@hrgui how about downloading the entire app again to another location (e.g. downloads folder) and start it from there?

Link: https://az764295.vo.msecnd.net/stable/9122ec4b1068bd391e41974f46a4b54c1b9c90f9/VSCode-darwin-stable.zip

So I downloaded, put it in home directory, ran /Users/harman.goei/Visual Studio Code.app/Contents/MacOS/Electron --verbose, and it seems to do the same thing.

(Also, do you know of a way to make the logs collapsable? i don't want to clutter this thread with logs)
````
➜ MacOS pwd
/Users/harman.goei/Visual Studio Code.app/Contents/MacOS
➜ MacOS ./Electron --verbose
[main 10:46:51 PM] Sending env to running instance...
[main 10:46:51 PM] Sent env to running instance. Terminating...
➜ MacOS ./Electron --verbose
[main 10:46:58 PM] Starting VS Code in verbose mode
[main 10:46:58 PM] from: /Users/harman.goei/Visual Studio Code.app/Contents/Resources/app
[main 10:46:58 PM] args: { _: [],
help: false,
h: false,
version: false,
v: false,
wait: false,
w: false,
diff: false,
d: false,
goto: false,
g: false,
'new-window': false,
n: false,
'unity-launch': false,
'reuse-window': false,
r: 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 }

````

@hrgui no worries about spamming this thread! ok so it seems to be unrelated from where you start it. I wonder if we can debug this better from within the application's blank screen: when you open dev tools in there and click on the sources tab, there is a way to let the debugger stop "pause on exceptions" (the blue thing in my screenshot) as well as "Pause on uncaught exceptions".

image

Can you:

  • first just have the blue thing checked
  • press Cmd+R from when devtools has focus anywhere
  • this should reload the window and it may break in the debugger if there is an error
  • if so, please let me know

If it does not break, click on the other checkbox ("Pause on uncaught exceptions")

  • follow the same steps
  • you will hit some errors right away that are unrelated, mainly return process.binding(atom_${process.type}_${name}) and return process.binding('icu'); but I wonder if there is another error hit after that?

screen shot 2017-04-05 at 10 56 24 pm

Error: No such module: atom_renderer_v8_util
    at Error (native)
    at process.atomBinding (/Applications/Visual Studio Code.app/Contents/Resources/electron.asar/common/init.js:5:20)
    at Object.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/electron.asar/renderer/init.js:23:22)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:402:7)

Stepping through some more:

Error: No such module: icu
    at Error (native)
    at importPunycode (url.js:5:20)
    at url.js:11:21
    at NativeModule.compile (bootstrap_node.js:505:7)
    at Function.NativeModule.require (bootstrap_node.js:446:18)
    at Function.Module._load (module.js:412:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at s (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/loader.js:4:25882)
    at t.load (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/loader.js:4:10583)

So far I don't see any other errors beside those... I'll investigate some more when I have time.

@hrgui thanks, this is weird. does it reproduce when you try our insiders channel? You can give our preview releases a try from: http://code.visualstudio.com/Download#insiders

This is happening to me as well (blank screen). I just updated to 1.11.0 (9122ec4b1068bd391e41974f46a4b54c1b9c90f9) after being prompted, using osx version 10.11.4.

I deleted the mainline app and tried redownloading with no success, and vs insiders (fresh download) shows the same symptoms. Insider build is at c90514387684a70e31f6db56540253cacc66c507

Nothing is being printed in developer tools console.

Removed Code from ~/Library/Application Support and still failed to start properly.

@aeschli This happened to me 3 times today (once in the office, twice at home).

After quit, it started up fine.

@joaomoreno how did you recover from it?

Just restart Code... so maybe it wasn't the same.

@bpasero Yes, I tried it with the insiders version, and it still did not work.

Also, I am just curious about the shell script in code - something about running code in shell script makes it work; if I run the contents of it 1-by-1 it does not work.

E.g.

if i run

'/Applications/Visual Studio Code.app/Contents/MacOS/Electron' '/Applications/Visual Studio Code.app/Contents/Resources/app/out/cli.js'

by itself, it fails to run, despite this is all it's doing.

@hrgui would be amazing if you could find that line in the script that makes it work after all if you can.

Could it be a difference in the environment variables? Could you run JSON.stringify(process.env, null, ' '); from the devtools' console (Help > Toggle Developer Tools) in both cases and compare the output of the two?

@chrmarti , there is a huge difference between the environment variables that I have.

Do you know how I can fix the environment variables to make sure they're always the same regardless of where I run code?

https://gist.github.com/hrgui/21789d72e8f6dc38c1ad7937448877c2

@szok Can you double-check if --verbose is indeed needed or if it is sufficient to run from the terminal in your case?

For me, --verbose is not needed. As long I run code via shell, everything gets set up correctly, including environment variables.

I'm having the same exact problem as @hrgui

Mac OS 10.12.4
VS Code 1.11.1 (Disabled all plugins too)

Works if I open it in terminal with and without --verbose, but doesn't open via Finder. When opening via finder, I get: 'Error: No such module: atom_renderer_v8_util'. I also have a huge difference in environment variables in running between them both as stated above.

The strange thing is that it opens fine on my personal user account (admin privileges), but I have a separate user account for work (also has admin privileges) where it's giving me this problem.

It has come to this.

I decided step through every single line of code and I noticed that the view changes greatly in the following line:

css.js (29-37)

        BrowserCSSLoader.prototype.attachListeners = function (name, linkNode, callback, errorback) {
            var unbind = function () {
                linkNode.removeEventListener('load', loadEventListener);
                linkNode.removeEventListener('error', errorEventListener);
            };
            var loadEventListener = function (e) {
                unbind(); 
                callback();
// After this line, the working version shows everything (just before the code), the non-working doesnt.
            };

I'll update as I go along and compare the calls. Please excuse me as I am not familiar with the code, but I am just shooting in the dark here.

Update 1

  • On the non working version, terminalWidgetManager.ts's constructor isn't invoked. The working version has a call stack of the following to get it to run:
    screen shot 2017-04-06 at 7 35 43 pm

Update 2
I compared the call graphs using the Timeline panel, and I noticed that the working version has a lot more events that happen way later, and the non-working version just stops on the load phase.

Update 3
Note: this might be unrelated
Pulling the latest version from github and running ./scripts/code.sh gives me the following errors:
screen shot 2017-04-06 at 8 19 55 pm

@chrmarti --verbose is not needed, just that there is "code" from the terminal and it works fine.
How to click on the application icon to continue to black screen.

If this issue is really related to the process environment, then I would suspect that it should work if you log in as guest user (or quickly create a new user account on the machine) and then start VS Code from finder. Could someone confirm that?

I am not sure if I am able to create a new user because it is my work computer (Macbook 2016)

However, I am suspecting it is process environment, because I am able to launch VSCODE 1.11.1 on my home computer under Mac OS X 10.12.3 (Macbook 2013)

Not having carefully read through this entire thread; I have the same issue.

I tried launching VSCode from a guest account on my Mac, and then I didn't get the black screen. Not sure if that is because it doesn't have the same extensions installed on the guest account, or something else though.

VSCode 1.11.1
macOS 10.11.6

@cbrevik you can rule out the extensions questions by running on your main account with disabled extensions:
From the command line (NOT the integrated terminal in Code), execute: code --disable-extensions and try your steps again to see if it reproduces.

@bpasero: Tried that now, and I still get a black screen on my main account.

@cbrevik does it work when you disable all network connections and try to run Code while being offline?

@bpasero No, I experience the same issue while unplugging ethernet and disabling wifi

@cbrevik what tool are you using to unzip when you download VS Code? And then, does it work when you run from the command line via code --user-data-dir <path to some empty folder>?

No special tool, just the in-built one in macOS (double-click in Finder). But this first started from updating VSCode inside VSCode itself. Not a manual download.

Same issue trying with that command and an empty folder.

@cbrevik so for you it does not work no matter if you start from finder or from the terminal, is that correct?

@bpasero correct. Opening from terminal or Finder produces the same result.

Just to clarify, today I was working with VSCode on macOS. It was working fine, then I got an alert for updating it. So I did, and after restarting VSCode I got the black screen.

So a bit later I tried downloading VSCode manually from the website, and replaced it in Applications. But the behavior is the same.

Oddly enough, I also cannot move the VSCode window by dragging it, but I can resize it.

@cbrevik I am preparing a build to try out something, are you still there?

@bpasero on the bus at the moment but I'll be available in about 10 minutes

@cbrevik good timing, can you:

image

@bpasero

before: process.lazyEnv

is all I see.

@hrgui anything in that ~/out.log file?

@bpasero
Same here: before: process.lazyEnv @ index.js:195

out.log has

begin: getUnixShellEnvironment()

out.log looks like this:
````

begin: getUnixShellEnvironment()
begin: getUnixShellEnvironment()%
````

@hrgui @cbrevik can you close that code instance, delete the out.log, open the following file from that downloaded app in an editor: Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js and replace the contents of the function getUnixShellEnvironment() with this one: https://gist.github.com/bpasero/8f57503ee529c5a014b8b95c576d16bf and then try again and attach the output of out.log?

Yay, it looks like I have a first relevant error from that log statement by stepping in devtools:
VM216:1 Error: ENOENT: no such file or directory, open '/Users/harman.goei/Downloads/Visual Studio Code 2.app/Contents/Resources/app/out/graceful-fs.js'(…)(anonymous function) @ VM216:1evaluate @ (program):113readFileAfterOpen @ fs.js:366

Error: ENOENT: no such file or directory, open 'original-fs.js' at Error (native)

begin: getUnixShellEnvironment()
1
2
3
4
5
6
7
8
9

@bpasero that's what I got in out.log

Mine is similar to @cbrevik , except, begin: getUnixShellEnvironment fires 4 times:

begin: getUnixShellEnvironment() begin: getUnixShellEnvironment() begin: getUnixShellEnvironment() begin: getUnixShellEnvironment() 1 2 3 4 5 6 7 8 9%

The fix for #21655 is the probable cause of this mess.

@hrgui @cbrevik almost there, can you do the exact same steps again, I have updated the getUnixShellEnvironment() code a little bit and attach the output here?

@joaomoreno
I reverted the fix on main.js to reflect https://github.com/Microsoft/vscode/commit/78bc68a1d06403ffc02f61e0043af682e8f3d681 and it seems like that is the culprit.

I'll double check to confirm.

@bpasero

fs.appendFileSync(logpath, "\n6"); var child = cp.spawn(process.env.SHELL, ['-ilc', command], { detached: true, stdio: ['ignore', 'pipe', process.stderr], // i changed this line from 'pipe' to 'ignore' env: env }); fs.appendFileSync(logpath, "\n7");

@bpasero Just begin: getUnixShellEnvironment() and before: process.lazyEnv again now

@hrgui Yep, reverting that also fixed it for me.

What shells do you guys use?

@joaomoreno I primarily use fishshell

@joaomoreno I use zsh, but chsh to zsh doesn't work for me, so for me it's just plain old bash when vscode reads it

correction: today i can finally chsh to zsh

@chrmarti @hrgui you are not getting any output anymore in out.log after my latest getUnixShellEnvironment() ?

@bpasero only begin: getUnixShellEnvironment(). After reverting like @hrgui described I'm getting a whole lot more though.

(You removed the counting log I saw though?)

Ok thanks, this indicates to me that the process we fork is never finishing and never produces any output. Maybe it is waiting on stdin for something.

Reverted the fix for #21655, will engage on better understanding the underlying issue.

Thanks for all the help guys. We'll get this fix out asap.

Adding verified label since we have at least 2 users confirming the fix solved the issue for them

I was having this issue (https://github.com/Microsoft/vscode/issues/23639#issuecomment-292163571) and updated my copy of VS Insiders this morning. It now works. 👍

(I too am using fish)

@ograycode thanks for letting us know

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DovydasNavickas picture DovydasNavickas  ·  3Comments

mrkiley picture mrkiley  ·  3Comments

biij5698 picture biij5698  ·  3Comments

shanalikhan picture shanalikhan  ·  3Comments

chrisdias picture chrisdias  ·  3Comments