microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
161.22k stars 28.3k forks source link

Error loading webview with a shared Virtualbox VM folder #219974

Open nipatriknilsson opened 1 month ago

nipatriknilsson commented 1 month ago

Does this issue occur when all extensions are disabled?: No, I can't find a native (built-in) webview to test with

Steps to Reproduce:

  1. In Virtualbox VM (host), create a shared folder vboxmanage sharedfolder add "Kali Linux #ide-code" --name "config" --auto-mount-point="/home/user/.config/Code" --hostpath="/home/user/Documents/sessions/code/ide/config_code" --automount
  2. In the VM: sudo mount -t vboxsf -o uid=user,gid=user,rw,remount "config" "/home/user/.config/Code"
  3. sudo chmod 700 "/home/user/.config/Code"

When I run an extension with Webview I get the error: Error loading webview: Error: Could not register service worker: AbortError: Failed to register a ServiceWorker for scope [...] The Service Worker system has shutdown.

Work-around:

  1. Mount the config directory using another name: vboxmanage sharedfolder add "Kali Linux #ide-code" --name "config" --auto-mount-point="/home/user/.config/Code_remote" --hostpath="/home/user/Documents/sessions/code/ide/config_code" --automount
  2. In the VM: mkdir -p /home/user/.config/Code
  3. sudo chmod 700 /home/user/.config/Code
  4. rsync -ac --delete-before /home/user/.config/Code_remote/ /home/user/.config/Code/
  5. code --password-store=basic --no-sandbox --wait /home/user/Projects/text-tree-view
  6. rsync -ac --delete-before /home/user/.config/Code/ /home/user/.config/Code_remote/
VSCodeTriageBot commented 1 month ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.91.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

nipatriknilsson commented 1 month ago

I tested with 1.91.0 and the issue is still there.