coder / code-server

VS Code in the browser
https://coder.com
MIT License
68.52k stars 5.61k forks source link

[Bug]: Unable to load resource on iPad Safari #5532

Closed shp7724 closed 4 months ago

shp7724 commented 2 years ago

Is there an existing issue for this?

OS/Web Information

Steps to Reproduce

  1. open code-server
  2. login

Expected

The editor should load.

Actual

White blank page.

Logs

...
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/browser/browser.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/cancellation.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/marshalling.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/event.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/lifecycle.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/parts/request/browser/request.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/resources.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/uri.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/platform/product/common/product.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/network.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/platform/window/common/window.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/strings.js
File not found: /opt/homebrew/Cellar/code-server/4.6.0/libexec/lib/vscode/out/vs/base/common/path.js

Screenshot/Video

스크린샷 2022-09-03 오전 3 01 36 스크린샷 2022-09-03 오전 3 01 48

Does this issue happen in VS Code or GitHub Codespaces?

Are you accessing code-server over HTTPS?

Notes

jsjoeio commented 2 years ago

This is very strange 🤔 How are you doing this exactly?

  1. install via homebrew on macOS
  2. expose and access on iPad?
shp7724 commented 2 years ago

Yes, I installed via homebrew and enabled HTTPS using nginx and certbot.

I managed to (temporalily) solve this issue by going through the whole installation process twice, which includes reinstalling everything(i.e. code-server, nginx, certbot) and reissuing ssl certificates. Reinstalling only one of them didn't solve the issue.

As far as I remember, I started seeing this issue when my ssl certificate got expired and reissued a new one. I don't see how it can be associated with this issue, though. :(

jsjoeio commented 2 years ago

I guess what would be helpful for me is to know how to reproduce this. Would these steps suffice?

  1. install code-server on macOS via homebrew
  2. run ngrok to expose code-server
  3. open on iPad in Safari
shp7724 commented 2 years ago

@jsjoeio It's been a quite a while, but I'm still suffering from this issue. The steps you suggested doesn't seem to be enough to reproduce it.

One thing I noticed though, is that all the failed requests are missing a cookie named code-server-session.

For instance, the following request succeeded with the cookie code-server-session:

image

whereas this request didn't (note the entire cookie is missing here):

image

If I copy the request as cURL and manually attach the same code-server-session cookie, it does seem to work.

I suspect this might have something to do with the internal session management mechanism of iPadOS safari.

shp7724 commented 2 years ago

Temporarily disabling and reenabling Prevent cross-site tracking option in settings, everything started to work as expected. 🤯😮

jsjoeio commented 2 years ago

Nice find!!! Can we close this now?

shp7724 commented 2 years ago

@jsjoeio

It turned out to be a coincidence, I'm afraid. 😔

jsjoeio commented 2 years ago

Darn it :( Okay well sadly, I don't have bandwidth to dive in now but feel free to leave comments here and I can be your async rubber duck

code-asher commented 4 months ago

I have seen this happen on a slow network where the bundle takes a while to load. It times out and tries to load the sources individually, which do not exist of course.

Closing but see https://github.com/coder/code-server/issues/2407