codota / tabnine-vscode

Visual Studio Code client for Tabnine. https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode
https://www.tabnine.com/install/vscodeֿ
MIT License
1.37k stars 180 forks source link

Error loading webview: Error: Could not register service worker: InvalidStateError: #1434

Closed Xachman closed 7 months ago

Xachman commented 7 months ago

please complete the following information:

If the issue is related to TabNine failure, please provide log files:

Type TabNine::config in your editor, the logs are located at the bottom of the page

Editor console logs:

Help -> Toggle Developer Tools

webviewElement.ts:512 An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.
mountTo @ webviewElement.ts:512
M @ overlayWebview.ts:218
claim @ overlayWebview.ts:120
kb @ webviewEditor.ts:178
setInput @ webviewEditor.ts:169
await in setInput (async)
S @ editorPanes.ts:445
L @ editorPanes.ts:270
openEditor @ editorPanes.ts:146
(anonymous) @ editorGroupView.ts:1124
Eb @ editorGroupView.ts:1148
Db @ editorGroupView.ts:1106
openEditor @ editorGroupView.ts:1012
openEditor @ editorService.ts:556
openWebview @ webviewWorkbenchService.ts:285
$createWebviewPanel @ mainThreadWebviewPanels.ts:167
S @ rpcProtocol.ts:458
Q @ rpcProtocol.ts:443
M @ rpcProtocol.ts:373
L @ rpcProtocol.ts:299
(anonymous) @ rpcProtocol.ts:161
y @ event.ts:1127
fire @ event.ts:1158
fire @ ipc.net.ts:650
z @ ipc.net.ts:1015
(anonymous) @ ipc.net.ts:875
y @ event.ts:1127
fire @ event.ts:1158
acceptChunk @ ipc.net.ts:394
(anonymous) @ ipc.net.ts:350
(anonymous) @ browserSocketFactory.ts:231
y @ event.ts:1127
fire @ event.ts:1158
j.onload @ browserSocketFactory.ts:92
index.html?id=4264d857-6ae3-44f1-aaa1-3ecf8692e0a0&origin=4354c190-2ccd-475d-8ee9-13909406d821&swVersion=4&extensionId=TabNine.tabnine-vscode&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&remoteAuthority=ssh-remote%2Bdev-v2:913 Webview fatal error: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..
(anonymous) @ index.html?id=4264d857-6ae3-44f1-aaa1-3ecf8692e0a0&origin=4354c190-2ccd-475d-8ee9-13909406d821&swVersion=4&extensionId=TabNine.tabnine-vscode&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&remoteAuthority=ssh-remote%2Bdev-v2:913
await in (anonymous) (async)
HostMessaging.channel.port1.onmessage @ index.html?id=4264d857-6ae3-44f1-aaa1-3ecf8692e0a0&origin=4354c190-2ccd-475d-8ee9-13909406d821&swVersion=4&extensionId=TabNine.tabnine-vscode&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&remoteAuthority=ssh-remote%2Bdev-v2:312
notificationsAlerts.ts:42 Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..

Issue Details:

I keep running into this issue on MacOS for some reason. It should be noted that I am using this with remote ssh. I also have this working fine on windows.

gz#29919

(related to Zendesk ticket #29919)

Xachman commented 7 months ago

Seems to be related to full disk access on vscode. After turning that on for vscode it seems to be working.