-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 assets do not load when requesting within Angular #15301
Comments
An update from my side: Service worker clients get corruptedIt appears that the clients available to the service worker do indeed change. Taking a snapshot of the state of Angular Router is the culpritJust to test, i removed the angular router from the app and that does resolve the issue. So i would consider that the work around for anyone who can accept removing the router and handling view loading manually. In my case it is doable. The fix is in the service workerTaking a look at the VSCode service worker that Theia's is based on, in their current version (V4) the service worker stores the ID from the search params locally on load as seen here and then later uses it here. A colleague of mine applied a simplified version of this in a local fork and it does indeed resolve the issue, I asked him to add a pull request for it. Currently i am workarounding this by removing the angular router, but I expect this to be fixed eventually as VSCode webview does not have this issue. GL |
With debugger attached, I experience this issue since Thursday last week with Chrome and since today with Edge. I don't use Angular for my project, but webviews with and without React. They open a lot slower and sometimes not even at all. My assumption is that it is related to a Chrome security update https://chromereleases.googleblog.com/2025/03/stable-channel-update-for-desktop_25.html
On a german new site (heise) it says
I really don't know if this is related. Just an assumption. |
Cool, it would also help if you could share the "basic angular application" you're using to reproduce. No point in us reinventing the wheel. |
Bug Description:
I am reporting this bug after this.
When loading an extension within Theia and activating its webview (by editing a custom file), some of the assets of the webview cannot be loaded caused by the following error:
service-worker.js:287:65
This error appears when the webview is actually an angular application. Somehow angular manages to break out of the resource fetching provided by the fake.html+service-worker.
This is a bug within Theia as the current version of the service-worker from VSCode does not have the same issue. Running the extension which contains an angular application as a webview, within vscode, does not cause the error, and all assets are loaded properly.
After a few hours of debugging, I have found the following:
const client = await self.clients.get(event.clientId);
here returns different clients for the same ID. Yes the event.clientId is the same between working and not working requests.Steps to Reproduce:
I have not been able to create a repo with a reproducible setup as this would require some effort to recreate the setup that I currently have again, for debugging and sharing purposes. If this issue cannot be resolved without it, I might need to create such an example repo.
Additional Information
The text was updated successfully, but these errors were encountered: