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

Regression introduced in Webviews #179295

Closed
qadram opened this issue Apr 5, 2023 · 9 comments · Fixed by #179824
Closed

Regression introduced in Webviews #179295

qadram opened this issue Apr 5, 2023 · 9 comments · Fixed by #179824
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded webview Webview issues
Milestone

Comments

@qadram
Copy link
Contributor

qadram commented Apr 5, 2023

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

  • VS Code Version: 1.77.1
  • OS Version: All

Steps to Reproduce:

This is not a problem in the extension, the extension code is the same, but a commit changes the way webviews are loaded and it's breaking it.

This commit:
f193f2a

Has introduced a regression that makes my extension unusable. It introduces a problem on webviews in which workers are not available, and causes the following errors in the console:

Found unexpected service worker controller. Found: undefined. Expected: service-worker.js?v=4&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&remoteAuthority=

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'active') at index.html?id=bec20bb6-e8e9-4468-aa44-b4e99f01e3ba&origin=fc8bf63c-5f3c-4cc5-8d01-08dc873d6c64&swVersion=4&extensionId=tmssoftware.tmswebcore&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app:442:34

I have been tracking all changes since 1.76.2 release, building VSCode myself, and setting the build to the previous commit, my webview works flawlessly, if I checkout this commit, it's totally broken.

I have not been able to send you are reproducible test case, but if interested, I can show you a video on how to use my extension, so you can check for yourself the issue.

Thanks!

@qadram
Copy link
Contributor Author

qadram commented Apr 5, 2023

To add more information, check these two videos:

  • Not working scenario, with the code at 1.77.1:
    not_working

  • Working scenario at the commit previous to the one I mention. Just remark that checking out the code at the commit I'm pointing, causes the not working scenario:
    working

@mjbvz
Copy link
Contributor

mjbvz commented Apr 5, 2023

Sorry you are running into this. Do you have an extension you can share that shows this issue?

I can't simply revert the change because it was made to fix an hang with webviews opening. If I can repo this locally though, I can try to investigate

@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug webview Webview issues labels Apr 5, 2023
@qadram
Copy link
Contributor Author

qadram commented Apr 6, 2023

Thanks for checking this one!

My extension is this one:
https://marketplace.visualstudio.com/items?itemName=tmssoftware.tmswebcore

Find attached a sample project:
testapp.zip

These are the steps:

  • Install the extension
  • Unzip testapp.zip in its own folder
  • Open the folder with VSCode
  • With Unit1.pas selected, issue the command Toggle Design/Code
  • This will open up the webview, and with the changes, you could see in the console the issues

Find here a video with the steps on how to open the webview, and the behavior when its working:

testapp

Thanks!

@qadram
Copy link
Contributor Author

qadram commented Apr 6, 2023

Needless to say that if I should perform any changes on the extension to make it work, it's not a problem at all. That is, if I can get an idea on what the changes are, have no problem on that. :-) Thanks!

@mjbvz mjbvz added this to the April 2023 milestone Apr 12, 2023
mjbvz added a commit to mjbvz/vscode that referenced this issue Apr 12, 2023
Fixes microsoft#179295

This should fix the `Cannot read properties of undefined (reading 'active')` error a few webviews were seeing when trying to load resources by using the current controller directly instead of trying to get it through the registration
@mjbvz
Copy link
Contributor

mjbvz commented Apr 12, 2023

Thanks for the repo steps @qadram!

I have a potential fix: #179824. Please try the next VS Code insiders build that comes out and let me know if you still see the problem. With the fix, things seem to be loading correctly:

Screenshot 2023-04-12 at 4 06 24 PM

@qadram
Copy link
Contributor Author

qadram commented Apr 13, 2023

Checked insiders, but not sure if the fix got through, as I see some checks failed:
image

Also tried update from the repository, and it seems still is not merged.

In any case, what I see in your shot is that the Tool Palette is missing content. The content is provided by loading an external file called "webcore.twcl" and it seems the webview is not able to load it:

image

Will keep checking, THANKS!

@qadram
Copy link
Contributor Author

qadram commented Apr 13, 2023

@mjbvz ignore my last message, I have merged your changes locally and works perfect! So once this is merged, consider the issue fixed, thanks a lot!!

image

mjbvz added a commit to mjbvz/vscode that referenced this issue Apr 13, 2023
Fixes microsoft#179295

This should fix the `Cannot read properties of undefined (reading 'active')` error a few webviews were seeing when trying to load resources by using the current controller directly instead of trying to get it through the registration
mjbvz added a commit that referenced this issue Apr 13, 2023
Fixes #179295

This should fix the `Cannot read properties of undefined (reading 'active')` error a few webviews were seeing when trying to load resources by using the current controller directly instead of trying to get it through the registration
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Apr 13, 2023
@mjbvz mjbvz added the author-verification-requested Issues potentially verifiable by issue author label Apr 24, 2023
@VSCodeTriageBot
Copy link
Collaborator

This bug has been fixed in the latest release of VS Code Insiders!

@qadram, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 3a69e15 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@qadram
Copy link
Contributor Author

qadram commented Apr 25, 2023

/verified

@VSCodeTriageBot VSCodeTriageBot added verified Verification succeeded and removed author-verification-requested Issues potentially verifiable by issue author labels Apr 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2023
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 insiders-released Patch has been released in VS Code Insiders verified Verification succeeded webview Webview issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants