Skip to content

Webviews blank over WSL: 401 from service worker when remote authority is "wsl+Ubuntu" (capital letter) #341398

Closed as not planned

Description

All webviews (Markdown preview, Claude Code extension panel, etc.) render blank when connected to WSL. Webviews work fine in local Windows folders.

VS Code: 1.141.1 (commit 7baac39), Electron 43.7.7, Chromium 150
OS: Windows 11 + WSL2, distro name "Ubuntu"

Steps to reproduce:

  1. Open a folder in WSL via code . from the Ubuntu shell (remote authority becomes wsl+Ubuntu)
  2. Open any .md file and run "Markdown: Open Preview"
  3. Preview is blank

Webview DevTools > Network: every webview resource fails with "401 Unauthorized (from service worker)", e.g.
https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home//.vscode-server/bin/7baac39ec3.../extensions/markdown-language-features/media/index.js

The direct vscode-remote-resource request to the server returns 200, so the server and connection token are fine. The resource hostname is lowercased (wsl+ubuntu) while the remote authority is wsl+Ubuntu, so the comparison against allowed resource roots appears to be case-sensitive and denies access.

Workaround: open with a lowercase authority. All webviews then work:
code --remote wsl+ubuntu /home//project

Ruled out: extension versions, VS Code caches, GPU acceleration, reinstalling the VS Code server, proxy (--no-proxy-server), symlinked home/.vscode-server.

Activity

  1. jdw-mpls commented on Oct 13, 2026

    @jdw-mpls

    I can confirm on the same build. Looks like a regression introduced in 1.141.x.

    VS Code: 1.141.1 (commit 7baac39), user installer, x64
    OS: Windows 11 + WSL2, distro "Ubuntu", launched with 'code .' from the Ubuntu shell

    Webview console shows 401 for every resource:
    'markdown.css', 'highlight.css', 'katex.min.css', 'index.css', and 'index.js' from both markdown-language-features and mermaid-markdown-features, served from vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/...

    Tried clearing the Windows-side VS Code caches (Service Worker, Cache, Code Cache, GPUCache, CachedData) and a clean profile pointing at an empty temp folder fails the same way

    Rolling back to 1.140.0 (commit 07f806f) fixes it.

  2. saulosag commented on Oct 13, 2026

    @saulosag

    I can confirm the problem in the same build (1.141.1 7baac39). It looks like it was introduced in commit b0240f4c8e. Running WSL_DISTRO_NAME=ubuntu code . is a functional workaround.

  3. JoelSimmo commented on Oct 14, 2026

    @JoelSimmo

    same as #341431

  4. a1fred0 commented on Oct 14, 2026

    @a1fred0

    Same fault here: VS Code 1.141.1 (7baac39), Windows 11, WSL2 distro Ubuntu. The Claude Code panel and other webviews were blank, with 401 on index.js and index.css.

    The case-sensitive compare is not in the root check. isEqualOrParent ignores case when it compares the authority. The fault is in loadResource in webviewElement, which looks up the remote OS (minified 1.141.1 bundle):

    let p = t.scheme === X.vscodeRemote
      && this._remoteAgentService.getConnection()?.remoteAuthority === t.authority
        ? (await this._remoteAgentService.getEnvironment())?.os
        : void 0;

    t.authority comes from the resource hostname, which the browser lowercases (wsl+ubuntu). The connection authority is wsl+Ubuntu, so the === is false and remoteOS is undefined. Then the root check returns at once (if (remoteOS === undefined) return;), and loadLocalResource returns AccessDenied, which the webview shows as 401.

    A case-insensitive compare at this line (for example, isEqualAuthority) is probably sufficient.

    This workaround works for me: code --folder-uri "vscode-remote://wsl+ubuntu/home/<user>".

  5. added
    bug
    webview
    regression
    on Oct 14, 2026
  6. alexr00 commented on Oct 14, 2026

    @alexr00
    Member

    duplicate of #341396

  7. gdeepakala commented on Oct 14, 2026

    @gdeepakala
    Author

    3. I can confirm the problem in the same build (1.141.1 7baac39). It looks like it was introduced in commit b0240f4c8e. Running WSL_DISTRO_NAME=ubuntu code . is a functional workaround.

    yeah - this works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

WSLbugregressionwebview

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions