Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: code-server + corporate proxy causing assertion failed error #141

Open
lrstanley opened this issue Jun 6, 2024 · 1 comment
Open

Comments

@lrstanley
Copy link

We run code-server in Kubernetes (i.e. through a browser), however, most extensions work without issue. When using excalidraw 3.7.4, I am noticing that I cannot open any excalidraw file, and it throws errors in the browser console

(see buildHtmlForWebview in stack trace):

GET https://TRUNCATED/TRUNCATED, 401 (authenticationrequired)
readFile @ webWorkerFileSystemProvider.ts:21
(anonymous) @ fileService.ts:666
I @ fileService.ts:688
D @ fileService.ts:583
C @ fileService.ts:520
readFile @ fileService.ts:503
await in readFile (async)
$readFile @ mainThreadFileSystem.ts:99
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1156
fire @ event.ts:1187
D.M.onmessage @ webWorkerExtensionHost.ts:215
log.ts:439   ERR Unknown (FileSystemError): authenticationrequired: Unknown (FileSystemError) (FileSystemError): Unknown (FileSystemError): authenticationrequired
	at w.e (../../../vs/workbench/api/worker/extensionHostWorker.js:100:7189)
	at Object.readFile (../../../vs/workbench/api/worker/extensionHostWorker.js:100:4463)
	at async D.buildHtmlForWebview (https://open-vsx.org/vscode/asset/pomdtr/excalidraw-editor/3.7.4/Microsoft.VisualStudio.Code.WebResources/extension/dist/extension.js#vscode-extension:3:13102)
	at async D.setupWebview (https://open-vsx.org/vscode/asset/pomdtr/excalidraw-editor/3.7.4/Microsoft.VisualStudio.Code.WebResources/extension/dist/extension.js#vscode-extension:3:11317)
	at async x.resolveCustomEditor (https://open-vsx.org/vscode/asset/pomdtr/excalidraw-editor/3.7.4/Microsoft.VisualStudio.Code.WebResources/extension/dist/extension.js#vscode-extension:3:8965)

Which looks to then cause this error:

Error: Assertion Failed: argument is undefined or null
    at d (types.ts:99:9)
    at l.resolve (customEditorInput.ts:340:36)
    at async a.setInput (webviewEditor.ts:153:3)
    at async n.S (editorPanes.ts:434:4)
    at async n.L (editorPanes.ts:254:34)
    at async n.openEditor (editorPanes.ts:131:11)
    at async editorGroupView.ts:1188:49
    at async u.value (explorerView.ts:526:6)

Looking at the code, it looks like this is the culprit:

const publicUri = vscode.Uri.joinPath(this.context.extensionUri, "public");
const content = await vscode.workspace.fs.readFile(
vscode.Uri.joinPath(publicUri, "index.html")
);

Is there a specific reason that it's configured to load the index.html directly from the extension repository (in my case, openvsx)?

I know the underlying reason for the authenticationrequired error, which is due to a corporate proxy (browser can't hit it, but code-server environment can, definitely understand that this is a niche issue).

Is there any way to bundle that index.html into the extension itself, so no external requests would be required?

code-server information:

code-server: v4.89.1
Code: 1.89.1
Commit: effc6e95b4ad1c5ac5f9083ec06663ba4a2e005c
Date: 2024-05-13T18:42:51.662Z (3 wks ago)
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0
@lrstanley
Copy link
Author

Looks like this is likely related to a few issues: #85 (maybe), coder/code-server#6306.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant