-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Webview is unable to load resources while reconstructing after a reload #89038
Comments
Can't reproduce this issue in the markdown preview with current VS Code insiders on MacOS 10.15.2 What MacOS version? |
I'm also on 10.15.2. Oddly enough, I just attempted to reproduce it again with markdown preview and it's working as expected. |
Ok, closing as not-reproducible |
It's still an issue for the codestream extension though |
How can I easily test that? |
Just install the extension and the webview should open immediately once installed. If it doesn't, use the |
I don't see the web view getting restored at all (no errors or anything). Does it have a serializer? |
Sorry, we just only re-display the webview if you're already logged in. We don't use a serializer. I've made a video reproducing it. It starts with the webview displayed correctly, I open up the dev tools and inspect the uri for the js we load, then reload the window. On reload, the webview panel is displayed again but left blank and in the webview dev tools, you'll see the error. The requested uri is still correct though. Then I'll close the corrupted webview and re-open it, and it works correctly again. |
I've now also seen this but only when the dev tools were open (on the main VS Code window) |
@mjbvz - Has this been attached to a future milestone yet? We're trying to find workarounds on our end but right now this is having a huge impact on our customers' experience. |
No but since you can reproduce this reliably, it would be good if you could try investigating what's going wrong:
It should wait until the protocol is registered before sending over the html but something is failing (possibly on the electron side) |
@mjbvz At the point where registerFileProtocol(contents, WebviewResourceScheme, fileService, getExtensionLocation(), getLocalResourceRoots);
this._resolve(); |
The registerFileProtocol calls in electron should now be synchronous, see #92138 |
@mjbvz while
|
This one should also be async now, see https://www.electronjs.org/docs/api/breaking-changes-ns#planned-breaking-api-changes The other callback ( |
This is one of the changes mentioned in that doc:
Just a hunch: Could it be that navigation is sometimes being triggered before the registration is started? (I couldn't find the relevant code) |
We also get this issue with my Dashboard extension, which uses a webview for a custom UI. Reopening the webview solves the problem. |
These planned changes in the API seem to be only enabled when I am not familiar with electron and how it is configured. I just did a quick search for @mjbvz Can you confirm whether |
This prevents from having to load the package locally with the buggy asWebviewUri (microsoft/vscode#89038) Closes #11
I just noticed the same issue while updating two of my extensions. I'm with VS Code 1.45 Stable and VS Code 1.46 Insiders, on MacOS. Loading on Windows, worked perfectly. The failed resources are a But, it only happens when the WebView is loaded at extension's activation, with in my case is defined as It's a bit weird, because I have the same WebView on other extensions and it is working fine. I thought it could be something related to recent updates I made on this Webview, but if I install older versions of the same extension (using the VS Code Extension feature), it also fails. Just noticed I didn't embrace https://code.visualstudio.com/updates/v1_39#_warning-if-webviews-dont-use-webviewaswebviewuri-for-local-resources yet. I'm still loading local resources using I'll try to update, and post here if something new appear. |
Unfortunately, didn't work 😞 . At first it appeared ok, but after a few retries, the issue reappeared. It's instable, at least. Just out of curiosity, using
Using
I hope the above PR should solve this, and be released as an patch to 1.45. Thank you |
@mjbvz does it have to be new Even if that pull request fixes things, it would still require all extension authors to update their extensions for the broken |
@RandomFractals Yes. Extensions that use |
Had to revert this fix due to #98768 Will revisit for June |
@mjbvz If you need to test with extensions for testing/reproduction, you can use mine. Just create a simple
and press |
Upstream VS Code bug (microsoft/vscode#89038). For now, load resource using `fs`. Revert when upstream issue is fixed.
I have not seen this in the last few weeks working on webview debugging or reproduce it as I used to be able to, thus marking verified. |
-- Commit: 2832fc3
-- Date: 2020-01-21T11:30:21.087Z
-- OS Version: OSX
Steps to Reproduce:
With CodeStream extension:
Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
With Markdown Preview:
EDIT: markdown preview seems fine now
The text was updated successfully, but these errors were encountered: