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 Extension stopped to work after last update #102044

Closed
AllanOricil opened this issue Jul 9, 2020 · 7 comments
Closed

Webview Extension stopped to work after last update #102044

AllanOricil opened this issue Jul 9, 2020 · 7 comments
Assignees
Labels
webview Webview issues

Comments

@AllanOricil
Copy link

AllanOricil commented Jul 9, 2020

  • VSCode Version: 1.47.0
  • OS Version: Windows 10

Steps to Reproduce:
My extension stopped to load the webview after updating VSCode.

image

I bundled the files I was getting from the CDN but the problem persists

image

I just updated the vscode and then it never opened again. This is the extension.
https://marketplace.visualstudio.com/items?itemName=allanoricil.salesforce-soql-editor&ssr=false

Does this issue occur when all extensions are disabled?: Yes/No

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 10, 2020

Hi, it looks like your extension is using the hardcoded vscode-resource uri scheme (see the getHtml4Path function)

You'll need to update to use the asWebviewUri function instead. See #97962 for details.

We have code that tries to automatically rewrite vscode-resource usages in html. Hover it does not rewrite your current html since it uses unquoted attribute for the file path:

Screen Shot 2020-07-09 at 5 12 05 PM

Try updating to use asWebviewUri as covered in #97962 and let me know if you still see problems

@mjbvz mjbvz added the webview Webview issues label Jul 10, 2020
@AllanOricil
Copy link
Author

Ok, but is is something you guys changed today? because it was working without any problem. I will follow the link you sent. Thanks you @mjbvz

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 10, 2020

Yes we change this in 1.47. However we have been recommended all extensions switch off hard coding vscode-resource for a while as that approach is not supported when vscode is run browsers

@AllanOricil
Copy link
Author

Yes we change this in 1.47. However we have been recommended all extensions switch off hard coding vscode-resource for a while as that approach is not supported when vscode is run browsers

thanks

@AllanOricil
Copy link
Author

AllanOricil commented Jul 10, 2020

@mjbvz I tried to add the method, but seems Im with problem with the vscode import.

Look, it cant find asWebviewUri

image

Also, my webview instance inside the panel only has these props

image

And I followed this example:

image

@AllanOricil
Copy link
Author

AllanOricil commented Jul 10, 2020

Found the issue!
I was using the old npm package. Changed to @types/vscode and now the method appears.
IT IS ALIVE AGAIN!
image

@AllanOricil
Copy link
Author

@mjbvz and @jrieken Could you help me with this issue #19582
Is there a documentation or a recipe to show how to add an Octicon in a CodeLenses extension? I want to place a "play" icon in a few places.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
webview Webview issues
Projects
None yet
Development

No branches or pull requests

2 participants