Code change:
// service worker already loaded & ready to receive messages postVersionMessage(currentController); } else { <del> console.log(`Found unexpected service worker controller. Found: ${currentController?.scriptURL}. Expected: ${swPath}`); </del> <ins> if (currentController) { console.log(`Found unexpected service worker controller. Found: ${currentController.scriptURL}. Expected: ${swPath}. Waiting for controllerchange.`); } else { console.log(`No service worker controller found. Waiting for controllerchange.`); } </ins> <del> // either there's no controlling service worker, or it's an old one: // wait for it to change before posting the message </del> <ins> // Either there's no controlling service worker, or it's an old one. // Wait for it to change before posting the message </ins> const onControllerChange = () => { navigator.serviceWorker.removeEventListener('controllerchange', onControllerChange); <del> postVersionMessage(navigator.serviceWorker.controller); </del> <ins> if (navigator.serviceWorker.controller) { postVersionMessage(navigator.serviceWorker.controller); } else { return reject(new Error('No controller found.')); } </ins> }; navigator.serviceWorker.addEventListener('controllerchange', onControllerChange); }

Related discussion:
text: <!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: No <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- 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: 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: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'active') at 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!
To add more information, check these two videos: Not working scenario, with the code at 1.77.1: ! 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: !
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
Thanks for checking this one!