code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: Unable to load resource on iPad Safari

Open shp7724 opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: Safari
  • Local OS: iPadOS
  • Remote OS: macOS
  • Remote Architecture: arm64
  • code-server --version: 4.6.0

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?

  • [X] I cannot reproduce this in VS Code.
  • [X] I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • [X] I am using HTTPS.

Notes

  • On macOS, everything works fine no matter which browser I use.
  • I tried reinstalling code-server several times.
  • If I refresh a lot of times, strangely it works sometimes. But most of the time it doesn't. I think the odds are lower on PWA mode.

shp7724 avatar Sep 02 '22 18:09 shp7724

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

  1. install via homebrew on macOS
  2. expose and access on iPad?

jsjoeio avatar Sep 06 '22 16:09 jsjoeio

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. :(

shp7724 avatar Sep 06 '22 16:09 shp7724

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

jsjoeio avatar Sep 06 '22 17:09 jsjoeio

@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 avatar Oct 14 '22 02:10 shp7724

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

shp7724 avatar Oct 14 '22 06:10 shp7724

Nice find!!! Can we close this now?

jsjoeio avatar Oct 14 '22 16:10 jsjoeio

@jsjoeio

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

shp7724 avatar Oct 19 '22 15:10 shp7724

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

jsjoeio avatar Oct 19 '22 20:10 jsjoeio

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

code-asher avatar Jul 11 '24 23:07 code-asher