Repository navigation
Description
Does this issue occur when all extensions are disabled?
Not tested — webviews from multiple unrelated extensions are affected (Atlassian atlassian.atlascode and GitHub.vscode-pull-request-github), which points at core webview resource loading.
- VS Code Version: 1.141.1 (commit
7baac39ec3ca969dab74ac12c097f6a486e46593), Electron 43.7.7, Chromium 150.0.7871.250 - OS Version: Windows (client) + WSL distro named
Ubuntu-26.04(remote)
Summary
When connected to a WSL distro whose name contains uppercase letters (Ubuntu-26.04), every extension webview stays blank. Their local scripts fail to load with 401 Unauthorized (from service worker). The same extensions render correctly in a local (non-WSL) window.
Steps to Reproduce
- Connect to a WSL distro whose name contains uppercase letters (here
Ubuntu-26.04). - Open any extension webview that loads local resources via
asWebviewUri, e.g. Atlassian: Open Settings or a GitHub Pull Request description. - Webview remains blank/loading.
Observed
Webview devtools:
GET https://vscode-remote+wsl-002bubuntu-002d26-002e04.vscode-resource.vscode-cdn.net/home/<user>/.vscode-server/extensions/atlassian.atlascode-4.0.32/build/static/js/mui.676585aa.js
401 Unauthorized (from service worker)
Note the webview iframe index.html query has remoteAuthority=wsl%2BUbuntu-26.04 (uppercase U), while the resource host is lowercase.
Window log (trace):
[trace] [Window] Webview.loadLocalResource - trying to load resource. requestUri=vscode-remote://wsl%2Bubuntu-26.04/home/<user>/.vscode-server/extensions/atlassian.atlascode-4.0.32/build/static/js/mui.676585aa.js, resourceToLoad=undefined
[trace] [Window] Webview.loadLocalResource - access denied. requestUri=vscode-remote://wsl%2Bubuntu-26.04/home/<user>/.vscode-server/extensions/atlassian.atlascode-4.0.32/build/static/js/mui.676585aa.js, resourceToLoad=undefined
The file exists on the remote at that path.
Suspected cause (from reading source; not verified with a debugger)
In 1.141.1, WebviewElement.loadResource resolves remoteOS only when the authority matches exactly:
const remoteOS = uri.scheme === Schemas.vscodeRemote && this._remoteAgentService.getConnection()?.remoteAuthority === uri.authority
? (await this._remoteAgentService.getEnvironment())?.os
: undefined;and getResourceToLoad now returns undefined (→ AccessDenied → 401) when remoteOS === undefined for vscode-remote URIs.
The authority is encoded into the resource hostname by asWebviewUri/encodeAuthority, and Chromium lowercases hostnames, so after decodeAuthority the request authority is wsl+ubuntu-26.04 while the connection authority is wsl+Ubuntu-26.04. The strict === comparison fails, so all remote webview resources are denied.
In 1.140.0, loadResource/getResourceToLoad had no remoteOS check, so this path did not exist there. (I have not yet confirmed by downgrading that 1.140 works on this machine.)
A case-insensitive authority comparison (e.g. via isEqualAuthority) would likely fix it.
Things already ruled out
- Restarting WSL (
wsl --terminate), reloading the window. - Corporate proxy / TLS interception: the 401 is produced by the webview service worker /
loadLocalResource, not the network. - Launching with an explicitly lowercase authority (
code --remote wsl+ubuntu-26.04 ...) did not help, presumably because the WSL resolver canonicalizes back to the distro name.
Activity
rnsk-ep commentedon Oct 13, 2026
Title: 1.141.1: extension webviews in WSL remote fail to load resources — 401 "Unauthorized (from service worker)"
Environment
VS Code 1.141.1 (commit 7baac39), Windows, User installer
Remote - WSL 0.104.3, distro name Ubuntu (remote authority wsl+Ubuntu)
Affected extension: Anthropic Claude Code 2.1.296 (installed on the WSL side)
Steps
Open a folder in WSL (wsl+Ubuntu).
Open the Claude Code sidebar view (a webviewView).
Expected: the webview loads its index.js / index.css and renders.
Actual: both requests fail, and the view stays empty. Webview DevTools shows:
GET https://vscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net/home/neal/.vscode-server/extensions/anthropic.claude-code-2.1.296-linux-x64/webview/index.js
Status Code: 401 Unauthorized (from service worker)
The extension sets localResourceRoots to [extensionUri/webview, extensionUri/resources] and loads its files with asWebviewUri, so the requested path is inside an allowed root.
Rolling back to 1.140.x fixes it, with no other changes. Restarting the WSL server and running wsl --shutdown did not help.
Possible cause (from reading the 1.141.1 build; not confirmed with a trace). In the renderer's loadResource, remoteOS is set only when connection.remoteAuthority === uri.authority, and the remote-root check returns access denied when remoteOS is undefined. That surfaces as status: 401. The request authority is decoded from the vscode-resource hostname, which Chromium lowercases (wsl-002bubuntu → wsl+ubuntu), while the connection authority is wsl+Ubuntu. The strict comparison would then fail for any WSL distro name containing an uppercase letter. Elsewhere, isEqualAuthority ignores case. I couldn't test a lowercase authority, because code --remote wsl+ubuntu still produced a wsl+Ubuntu connection.
Tekime commentedon Oct 13, 2026
Confirming this also affects the built-in Markdown preview in my environment. Did not occur prior to 1.141.1.
UbuntuMarkdown previews became blank after updating. Reloading the window, closing all editor tabs, and manually opening fresh previews did not resolve it. The console shows 401 Unauthorized for the built-in Markdown preview’s JavaScript and CSS resources.
The iframe URL contains
remoteAuthority=wsl%2BUbuntu, while resource requests usevscode-remote+wsl-002bubuntu.vscode-resource.vscode-cdn.net.Launching with
code --new-window --remote wsl+ubuntu ...still produced the uppercase connection and failed.Confirmed workaround: close existing VS Code windows for the project, then launch with:
code --new-window --folder-uri "vscode-remote://wsl+ubuntu/home//project"
Markdown previews work when opened this way.
Victorsss-Orz commentedon Oct 13, 2026
Confirming this also affects the built-in image preview in my environment. Did not occur prior to 1.141.1.
UbuntuAttempting to open a png image shows "An error occurred while loading the image"
yoimar commentedon Oct 14, 2026
I experienced the same issue with VS Code 1.141.1 on Windows + WSL2 (Ubuntu), using the OpenAI Codex extension.
Initially, Codex failed to start, then got stuck on the loading screen with
401 Unauthorized (from service worker)errors when loading JavaScript resources.I tried reinstalling Codex, clearing caches, rebuilding VS Code Server, and restarting WSL, but nothing worked.
The workaround from #341398 fixed it for me:
WSL_DISTRO_NAME=ubuntu code -n .After launching VS Code with this command, Codex loaded successfully.
Sharing this in case it helps others experiencing the same issue. Thanks!
riteshrm commentedon Oct 14, 2026
thanks Yoimar (@yoimar)
Raulinho-A commentedon Oct 14, 2026
Confirmed on VS Code 1.141.1 (
7baac39), Windows + WSL2,distro
Ubuntu-24.04, Remote - WSL 0.104.3, and Codexextension 26.1007.21434.
Both Codex and the built-in Markdown preview failed to render,
with webview JavaScript/CSS requests returning 401.
Reinstalling the WSL extension and rebuilding VS Code Server
did not help.
Passing
--remote wsl+ubuntu-24.04from WSL failed with:“Option 'remote' is defined more than once. Using value
'wsl+Ubuntu-24.04'.”
An explicit lowercase
--folder-urifixed both panels.Following the workaround discussed in #341398, I added this
Zsh function to keep using
code .:The lowercase distro name addresses the webview issue.
CODEX_HOMEseparately ensures Codex uses my existing WSLchat history; it is not part of the 401 fix.
10 remaining items
sanity: check webview resource loading (#342227)
sanity: run the WSL tests on WSL2 again and fix the WSL desktop launch (
sanity: run WSL tests again and check webview resource loading