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

Extension Development: Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME #98231

Closed
hediet opened this issue May 20, 2020 · 4 comments
Closed

Comments

@hediet
Copy link
Member

hediet commented May 20, 2020

  • VSCode Version: 1.45.1
  • OS Version: Windows 10

Context

Load a resource like so:

const vsuri = webview.asWebviewUri(
  Uri.file(
    path.join(__dirname, "../drawio/src/main/webapp/index.html")
  )
);
webview.html = `...  ${vsuri.toString()} ...`; // this loads something from vsuri

Launch the Extension Development Host VS Code Instance and ensure that it loads this webview on startup.
You can do this by registering a custom editor that uses such a webview and open such a custom editor before closing the Extension Development Host. The next time the Extension Development Host is started, the custom editor will load the webview. This usually (>70% chance) produces the following error:

The Error

image

Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME

I guess it refers to vscode-resource://.

It only happens on startup, and possibly only in the extension dev host. If I close the the webview and reopen it, it works (this rules out a bug in my extension).

A minimal reproducible extension is some serious work. Others have this same issue.

@hediet
Copy link
Member Author

hediet commented May 20, 2020

It actually also happens when bundling the extension and installing it manually, but much less often (like once for 10 refreshes). So it is not a development only issue.

@hediet
Copy link
Member Author

hediet commented May 20, 2020

It already happens for the markdown preview feature:

image

You can see that it did not load the style sheet:
image

I haven't managed to reproduce it with all extension disabled though. I guess this bug is timing related.

@Speedy37
Copy link

Might be fixed by #97777

@hediet
Copy link
Member Author

hediet commented May 20, 2020

Ah. Duplicate of #89038.

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

No branches or pull requests

2 participants