vscode: Webview is unable to load resources while reconstructing after a reload
- VSCode Version: Insiders Version: 1.42.0-insider – Commit: 2832fc3c234daeda025f205a862703ba7eee6a10 – Date: 2020-01-21T11:30:21.087Z – OS Version: OSX
Steps to Reproduce:
With CodeStream extension:
- Open the webview
- Reload the window
- CodeStream panel will be blank
- Open webview dev tools
- The console will contain errors like
Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME
- Close the blank panel
- Re-open the CodeStream view
- Content should be displayed
With Markdown Preview:
- Open markdown preview for a markdown file
- Reload the window
- Preview panel will display message about an error restoring
EDIT: markdown preview seems fine now
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 16
- Comments: 33 (14 by maintainers)
Commits related to this issue
- Add explicit wait on protocol registration Possible fix for #89038/#91506. In both cases, it looks like we try to use the protocol before it is properly registered. If this fix doesn't work, there's ... — committed to microsoft/vscode by mjbvz 4 years ago
- Fix freeze/unfreeze buttons. — committed to leanprover/vscode-lean by gebner 4 years ago
- The final workaround. Addresses https://github.com/microsoft/vscode/issues/89038 Since `vscode-resource:` is randomly broken in webviews, we're just going to run our own web server on localhost. Th... — committed to leanprover/vscode-lean by gebner 4 years ago
- :alien: (index.html) Use CDN to load cytoscape-node-html-label package This prevents from having to load the package locally with the buggy asWebviewUri (https://github.com/microsoft/vscode/issues/89... — committed to bamlab/conceptor by guitoof 4 years ago
- removed speedscope; reverted chunk bundling due to https://github.com/microsoft/vscode/issues/89038 — committed to BartmanAbyss/vscode-amiga-debug by BartmanAbyss 4 years ago
- Fix webview script loading. Upstream VS Code bug (https://github.com/microsoft/vscode/issues/89038). For now, load resource using `fs`. Revert when upstream issue is fixed. — committed to agrawal-d/cph by agrawal-d 4 years ago
We are currently having this same error in our extension.
Steps to reproduce:
Expected:
Actual:
Reproducer:
@RandomFractals Yes. Extensions that use
asWebviewUri
will just automatically start using the new protocol. The PR also tries to rewrite any hardcodedvscode-resource
uris (which have been deprecated for a while since they also don’t work on web)same issue with my extension https://github.com/ConsenSys/vscode-solidity-metrics/issues/1 (https://marketplace.visualstudio.com/items?itemName=tintinweb.solidity-metrics)
mostly happens right after starting vscode. closing the web-view and trying again usually works.
repro:
ERR_UNKNOWN_URL_SCHEME
on all thevscode-resource://
URI’s.if you cannot reproduce: close (reload) vscode and try again
permanent workaround: pack everything into one HTML file and avoid loading
vscode-resource://
URI’s.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.
Had to revert this fix due to #98768
Will revisit for June
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
scheme: "vscode-resource"
gives me this:Using
asWebviewUri
has a slight different syntax:I hope the above PR should solve this, and be released as an patch to 1.45.
Thank you
This one should also be async now, see https://www.electronjs.org/docs/api/breaking-changes-ns#planned-breaking-api-changes
The other callback (
async (request, callback: any)
) is the handler for requests themselves once they come in