# SOLVED: VS Code Webview Service Worker Error in Firebase/Google Cloud Workstations - Kaspersky Antivirus Issue

**URL:** https://community.firebasestudio.dev/t/solved-vs-code-webview-service-worker-error-in-firebase-google-cloud-workstations-kaspersky-antivirus-issue/19133
**Category:** General
**Tags:** troubleshooting
**Created:** [October 2, 2025, 2:37pm UTC](https://community.firebasestudio.dev/t/solved-vs-code-webview-service-worker-error-in-firebase-google-cloud-workstations-kaspersky-antivirus-issue/19133 "2025-10-02T14:37:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mundo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/mundo/32/3571_2.png) [@Mundo](https://community.firebasestudio.dev/u/Mundo)
#### Post date: [October 2, 2025, 2:37pm UTC](https://community.firebasestudio.dev/t/solved-vs-code-webview-service-worker-error-in-firebase-google-cloud-workstations-kaspersky-antivirus-issue/19133/1 "2025-10-02T14:37:10Z")

</div>

I am writing this article for people who are like me, beginners and non-tech experts, so I am highlighting the steps that worked for me after struggling with it for some time. When the webview stopped working for me, I was upset, so what you see below is a collection of what I have found:

## **Problem Description**

When using Firebase Studio or Google Cloud Workstations with VS Code in the browser, you may encounter this error:

```

Error loading webview: Error: Could not register service worker: SecurityError:

Failed to register a ServiceWorker: The provided scriptURL

(‘https://…cloudworkstations.googleusercontent.com/…/service-worker.js’)

violates the Content Security Policy.

```

> **Note: You might not face this issue when you first start your project, even while having your anti-virus active. For me, it started after a week or so**

## **Root Cause**

**Kaspersky antivirus** (version 2025) blocks service worker registration in Cloud Workstations due to:

- SSL/HTTPS traffic interception
- Content Security Policy header injection
- Script injection into web traffic
- Encrypted connection scanning

## **Solution**

If you have **Kaspersky Standard, Plus, Premium, or Small Office Security** installed, follow these steps:

> For me I was using Premium

**Step 1: Configure Addresses to be Trusted**

1. Open Kaspersky → Click **Settings** icon (gear)
2. Go to **Security settings**
3. Click **Network Settings**
4. Click **Configure Trusted Addresses**
5. Click **Add** and enter each of these domains:
  1. `*.cloudworkstations.googleusercontent.com`
  2. `*.cloudworkstations.dev`
  3. `*.firebaseapp.com`
  4. `*.firebase.com`

6. Click **OK** → **Save**

**Step 2: Restart Browser**

1. **Completely close** your browser (all tabs and windows)
2. Clear browser cache (optional but recommended)
3. Reopen your Cloud Workstation

> **Verification**
> 
> After completing these steps, the service worker error should be resolved, and VS Code extensions/webviews should load normally in your Cloud Workstation.

**Alternative Quick Test**

To confirm Kaspersky is causing the issue:

- Temporarily pause Kaspersky protection (5 minutes)
- Reload your Cloud Workstation
- If the error disappears, Kaspersky is confirmed as the cause
- Re-enable protection and apply the exclusions above

**Additional Notes**

- This issue affects other cloud development environments too (GitHub Codespaces, Gitpod, etc.)
- **Do not disable your antivirus completely** - use exclusions instead
- The wildcard `*` ensures all subdomains are covered
- Kaspersky’s SSL certificate interception breaks WebSocket connections required by Cloud Workstations

**Related Issues**

This solution could also fix the following:

- Extension installation failures
- WebSocket connection error

**Tested with:**

- Kaspersky Standard/Plus/Premium 2025
- Google Cloud Workstations
- Firebase Studio
- Chrome

Hope this helps others experiencing the same issue!

And if there was any mistake in my post, let me know, please

---

<div class="post-metadata">

### Author: ![Antonio\_Scott](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/antonio_scott/32/9291_2.png) [@Antonio\_Scott](https://community.firebasestudio.dev/u/Antonio_Scott)
#### Post date: [October 3, 2025, 9:23pm UTC](https://community.firebasestudio.dev/t/solved-vs-code-webview-service-worker-error-in-firebase-google-cloud-workstations-kaspersky-antivirus-issue/19133/2 "2025-10-03T21:23:33Z")

</div>

I see this kind of stall a lot when dev environments are misaligned or dependencies break mid-boot. Here’s a tactical checklist to un-stick your project:

🔧 **Stall Diagnosis & Recovery Steps**

1. **Clear `.firebase`, `node_modules`, and `.cache`**  
Sometimes leftover state corrupts startup.

2. **Check local `.firebaserc` & `firebase.json`**  
Corrupted or conflicting config can block startup.  
Ensure your project alias matches and hosting / functions entries are valid.

3. **Run in verbose / debug mode**

4. **Check for locked ports**  
Another process may be occupying the port (e.g. 5000, 9000).  
Use `lsof -i :5000` or Windows equivalent to see if it’s blocked.

5. **Validate your SDK versions**  
Incompatibility between Firebase tools, Node.js versions, and the project’s dependencies often break boot.  
Use the version ranges specified in your `package.json`.

6. **Permissions / Disk Quota**  
In cloud-based dev workstations, disk usage or file permission issues can stall process spawn.  
Check quotas, read/write access to the project folder.

7. **Reinitialize environment**  
As a last resort, clone a fresh copy of the repo (or branch) and re-run `firebase init`, re-link the project, then deploy from scratch.

⚠ Many hangs are due to hidden state or mismatch rather than actual Firebase server bugs. If you try the above and still get stuck, share the first 50 lines of your debug log (from `firebase serve --debug`) — I’ll help you pinpoint the root cause.

(_If you want, I can send this as a neatly formatted Manual PDF you can keep for future stalls — DM me if you’d like that.)_

---

<div class="post-metadata">

### Author: ![noh\_b](https://avatars.discourse-cdn.com/v4/letter/n/e95f7d/32.png) [@noh\_b](https://community.firebasestudio.dev/u/noh_b)
#### Post date: [January 5, 2026, 7:25pm UTC](https://community.firebasestudio.dev/t/solved-vs-code-webview-service-worker-error-in-firebase-google-cloud-workstations-kaspersky-antivirus-issue/19133/3 "2026-01-05T19:25:41Z")

</div>

This absolutely worked for me! Thank you! Love Kasperkey BUT when it comes to some stuff like this….ufffffffff!
