Skip to content

Black Screen When Using Nginx #333

@vedantroy

Description

@vedantroy
  • code-server version: 1.32.0
  • OS Version: Ubuntu 18 LTS (aws t2.micro)

Description

I am self hosting code server. When I first tried to run code-server, I ran into this error: #121. I fixed the error by specifying -d /home/[user]/.code-server and manually creating /home/[user]/.code-server/Backups/workspaces.json as a blank file.

However, while code server allows me to log in, I get a grey screen and the following error prints to the console:

ERROR SHARED stderr {"data":"Uncaught Exception: Error: Unexpected end of JSON input\n\nSyntaxError: Unexpected end of JSON input\n at JSON.parse (<anonymous>)\n at pfs_1.readFile.then.contents (eval at exports.requireModule (/home/ubuntu/code-server-1.32.0-310-linux-x64/code-server:468:27684), <anonymous>:77277:45)\n at <anonymous>\n at Timeout.setTimeout [as _onTimeout] (eval at exports.requireModule (/home/ubuntu/code-server-1.32.0-310-linux-x64/code-server:468:27684), <anonymous>:52540:31)\n at ontimeout (timers.js:498:11)\n at tryOnTimeout (timers.js:323:5)\n at Timer.listOnTimeout (timers.js:290:5)\n"}

I am using the following command:
code-server --allow-http -p 3001 -d .code-server/ my-project-dir
I am using allow-http because I am using nginx as a reverse proxy.

Steps to Reproduce

  1. Use binary installation of code server.
  2. Create blank /home/[user]/.code-server/Backups/workspaces.json file
  3. Run code-server -p <some port> -d .code-server/
  4. Log in
  5. You should see a blank grey screen and an error should be printed to the console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions