I’m working on learn-sql-by-building-a-student-database-part-2. Everytime I load it today, I get an error, whereby the CodeRoad window remains blank and en error message pops up bottom right. It reads:
“Error loading webview: Error: Could not register service workers: SecurityError: The operation is insecure”
Anybody else getting this? Is there a workaround I can try? I’ve tried loading straight in codeally and, whilst that worked yesterday (when I was experiencing above issue as well), today their playground is 404ing.
moT01
June 7, 2022, 7:23pm
2
I’m not seeing this - are you still having problems @obarzanka ? Everything looks like it loaded up for you there. I would try to close CodeRoad and open it back up manually. There’s instructions and a gif here - it may take a few tries. Let us know if that works.
hey, thanks for checking! I’m still getting the issue, ie I load coderoad and then nothing comes up. I’ve followed the instructions in the gif, but just coming up with the error as usual
1 Like
moT01
June 23, 2022, 1:48am
4
Were you ever able to get it working @obarzanka ? If so, what did you do?
Hello! I wasn’t ever able to get it working. And annoyingly when I’ve gone through CodeAlly directly, my completed challenges don’t transfer over
1 Like
The error may be related to a Firefox setting. Are you using Firefox?
See related links:
opened 04:52PM - 25 Jan 19 UTC
closed 02:31AM - 22 Jul 19 UTC
type: bug/fix
freq2: medium
comp: service-worker
# 🐞 bug report
### Affected Package
@angular/service-worker
### Is this… a regression?
Probubly not, after looking at the commit history of [module.ts](https://github.com/angular/angular/blob/master/packages/service-worker/src/module.ts) it seems the issue has been there ever since.
### Description
After creating a base Project and adding Service Worker then opening it on Firefox (mine is at version 64): it works normally.
But after going to Firefox's cookie setting and setting its cookie preference to "Keep unitl Firefox is closed", the browser then complains about `SecurityError`
Although the comment at [module.ts line 46](https://github.com/angular/angular/blob/master/packages/service-worker/src/module.ts#L46) expresses that not returning the promise will prevent the App from crashing. SDKs like [Sentry](https://sentry.io) does catch and log them.
I do extra custom things with Sentry, and skipping this particular exception is needed (since its not actually an exception).
Adding an noop `.catch(() => void 0)` to [module.ts line 47](https://github.com/angular/angular/blob/master/packages/service-worker/src/module.ts#L47) does quiet things down.
Will submit a PR with that code, just going to wait for a while to see if the community has some thoughts first.
## 🔬 Minimal Reproduction
1. Create the Project with Service Worker
```
ng new test-project
cd test-project
ng add @angular/pwa
ng build --prod
```
2. Serve files using `http-server` and open `http://localhost:8080` using a later version of Firefox:
```
http-server dist/test-project/
```
3. Go to Firefox's cookie preference to "Keep unitl Firefox is closed"
4. Open DevTools and see the stack trace.
## 🔥 Exception or Error
<details>
<summary>ERROR Error: "Uncaught (in promise): SecurityError: The operation is insecure</summary>
```
ERROR Error: "Uncaught (in promise): SecurityError: The operation is insecure
Ef/</<@http://localhost:8080/main.5f246923deb4ae88197d.js:1:189419
0TWp/</</c</e.prototype.invoke@http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:7102
onInvoke@http://localhost:8080/main.5f246923deb4ae88197d.js:1:66110
0TWp/</</c</e.prototype.invoke@http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:7029
0TWp/</</i</t.prototype.run@http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:2288
I/<@http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:13769
0TWp/</</c</e.prototype.invokeTask@http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:7777
onInvokeTask@http://localhost:8080/main.5f246923deb4ae88197d.js:1:66022
0TWp/</</c</e.prototype.invokeTask@http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:7690
0TWp/</</i</t.prototype.runTask@http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:2951
g@http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:10048
P http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:13020
D http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:12118
Z http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:12220
invoke http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:7102
onInvoke http://localhost:8080/main.5f246923deb4ae88197d.js:1:66110
invoke http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:7029
run http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:2288
I http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:13769
invokeTask http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:7777
onInvokeTask http://localhost:8080/main.5f246923deb4ae88197d.js:1:66022
invokeTask http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:7690
runTask http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:2951
g http://localhost:8080/polyfills.f5ce8ecea387adbb1689.js:1:10048
```
</details>
## 🌍 Your Environment
<pre><code>
Angular CLI: 7.2.3
Node: 10.7.0
OS: linux x64
Angular: 7.2.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.12.3
@angular-devkit/build-angular 0.12.3
@angular-devkit/build-optimizer 0.12.3
@angular-devkit/build-webpack 0.12.3
@angular-devkit/core 7.2.3
@angular-devkit/schematics 7.2.3
@angular/cli 7.2.3
@angular/pwa 0.12.3
@ngtools/webpack 7.2.3
@schematics/angular 7.2.3
@schematics/update 0.12.3
rxjs 6.3.3
typescript 3.2.4
webpack 4.28.4
</code></pre>
opened 08:35PM - 18 Apr 22 UTC
closed 02:29AM - 20 Apr 22 UTC
### Bug description
When opening a GitHub repository as a GitPod workspace, t… he following error is shown continuously: `Error loading webview: Error: Could not register service workers: SecurityError: The operation is insecure.`
Screenshot:

I'm using:
- Fedora Linux 35
- Firefox 98.0.2(64 bit) (Flatpack version)
Hi @obarzanka I solved the issue. The issue is based on a firefox cookie policy or restriction. In my case I’m usign Mozilla Firefox 101.0.1 Version for Windows 10. You must disable Cookie Tracking, select Custom settings under Enhacing tracking protection, and the unselect cookies. Let me know if this works for you, for me takes 1.5 hours of investigation. (Firefox issue explanation: 1725216 - github.dev triggers "Error loading webview: Error: Could not register service workers: SecurityError: The operation is insecure.." if you have tracking protection configured to block cross-site cookies (the default in Nightly) ), Next you can see the options in Firefox:
PD: And happened to me again. I just Only enabled and disabled the “Coookies” Box then I reloaded all the tabs and Works Again
6 Likes
I could cry! Maybe an overreaction but it works! Thank you so much for doing such a deep dive. Really appreciate it
1 Like
And happened to me again. I just Only enabled and disabled the “Coookies” Box then I reloaded all the tabs and Works Again