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

Webview resources not loading - ERR_UNKNOWN_URL_SCHEME (vscode-insiders) (AGAIN) #101093

Closed
mhutchie opened this issue Jun 26, 2020 · 5 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority insiders-released Patch has been released in VS Code Insiders verified Verification succeeded webview Webview issues

Comments

@mhutchie
Copy link

mhutchie commented Jun 26, 2020

This bug was first reported in #100879 & #100918, was fixed in Visual Studio Code Insiders 9b620b2, then reintroduced in the latest Visual Studio Code Insiders release (information below).

Please fix this asap - it has already fatally affected all Visual Studio Code Insiders users of all extensions that use Webviews (including my own) for 2.5 days just to get it fixed the first time, now it's broken again within 12 hours of it being fixed!


  • Version: 1.47.0-insider (user setup)
  • Commit: 6c235c7
  • Date: 2020-06-26T06:20:06.931Z
  • Electron: 8.3.3
  • Chrome: 80.0.3987.165
  • Node.js: 12.13.0
  • V8: 8.0.426.27-electron.0
  • OS: Windows_NT x64 10.0.18362

I'm the author of the Git Graph extension. This bug is affecting all Git Graph users that use Visual Studio Code Insiders, as well as every other extension I'm aware of that loads resources (e.g. CSS, JS) in Webview's (more specifically, resources loaded by Webview.asWebviewUri). I can replicate bug on Windows & Mac, I've had reports of this from many users.

Steps to Reproduce:

  1. Install an extension that uses a Webview (Git Graph for the following steps)
  2. Open Visual Studio Code in a Git repository.
  3. Click the "Git Graph" Status Bar Item
  4. Observe that the CSS & JS resources aren't loaded:
    image
  5. If you run the Visual Studio Code command "Open Webview Developer Tools", the following errors can be seen:
    image

Does this issue occur when all extensions are disabled?: No (Because it only affects extensions that use Webview's)

The resolution of this issue is being tracked for Git Graph users here.

@mhutchie
Copy link
Author

Looping in @mjbvz

@mhutchie mhutchie changed the title Webview resources not loading - ERR_UNKNOWN_URL_SCHEME (vscode-insiders) Webview resources not loading - ERR_UNKNOWN_URL_SCHEME (vscode-insiders) (AGAIN) Jun 26, 2020
@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug webview Webview issues labels Jun 26, 2020
@deepak1556
Copy link
Collaborator

@mjbvz the issue seems to happen only with the packaged build, OSS works fine.

If you check window.location.href in the webview devtools for OSS it will print the correct uri vscode-webview://.... , but in the packaged build its chrome-error://chromewebdata which is the error page chromium loads when the top level navigated file is not found, the net::ERR_UNKNOWN_URL_SCHEME are just a side effect of loading subresources in an elevated permission page.

The root issue is the path to the entry virtual document is incorrect in packaged build.

@mjbvz
Copy link
Collaborator

mjbvz commented Jun 26, 2020

Thanks @deepak1556. From that I believe I was able to trace the issue to having spaces (or other special uri characters) in your install path. I'll queue up another insiders build for testing

@mhutchie
Copy link
Author

Thanks @mjbvz & @deepak1556 for getting this resolved!

Webviews are now working again in Visual Studio Code Insiders:

  • Version: 1.47.0-insider (user setup)
  • Commit: 9bf6af0
  • Date: 2020-06-26T18:55:07.038Z
  • Electron: 8.3.3
  • Chrome: 80.0.3987.165
  • Node.js: 12.13.0
  • V8: 8.0.426.27-electron.0
  • OS: Windows_NT x64 10.0.18362

@mjbvz
Copy link
Collaborator

mjbvz commented Jun 26, 2020

Sorry for the breaking. We've been rewriting parts of the webview implementation this iteration and this has caused a lot of interesting bugs

We do have webview test that try loading resources so I'll investigate why this wasn't caught before the release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority insiders-released Patch has been released in VS Code Insiders verified Verification succeeded webview Webview issues
Projects
None yet
Development

No branches or pull requests

5 participants
@deepak1556 @mhutchie @rzhao271 @mjbvz and others