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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悶] service-worker.js error: Cannot read properties of undefined (reading 'ok') #4563

Closed
DustinJSilk opened this issue Jun 22, 2023 · 3 comments
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@DustinJSilk
Copy link
Contributor

Which component is affected?

Qwik Runtime

Describe the bug

After updating to the latest dev commit, an error started to throw on production builds. Ive been unable to reproduce it myself, however, on my colleagues latest browsers with disabled caches it happens consistently. Ive not been able to figure out why.

This is the full error:

The FetchEvent for "<URL>" resulted in a network error response: the promise was rejected.
19service-worker.js:5 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'ok')
    at service-worker.js:5:821
q-c8cc3f09.js:1321 Cross-Origin-Opener-Policy policy would block the window.closed call.
e @ q-c8cc3f09.js:1321
q-c8cc3f09.js:1321 Cross-Origin-Opener-Policy policy would block the window.closed call.
e @ q-c8cc3f09.js:1321
q-c8cc3f09.js:1321 Cross-Origin-Opener-Policy policy would block the window.closed call.
e @ q-c8cc3f09.js:1321
q-c8cc3f09.js:1321 Cross-Origin-Opener-Policy policy would block the window.closed call.
e @ q-c8cc3f09.js:1321
/build/q-855adf5c.js:1     Failed to load resource: net::ERR_FAILED
/build/q-ec715aab.js:1     Failed to load resource: net::ERR_FAILED
/build/q-496a0a29.js:1     Failed to load resource: net::ERR_FAILED
6service-worker.js:5 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'ok')
    at service-worker.js:5:821
/build/en/q-855adf5c.js:1     Failed to load resource: net::ERR_FAILED
/build/en/q-ec715aab.js:1     Failed to load resource: net::ERR_FAILED
/build/en/q-496a0a29.js:1     Failed to load resource: net::ERR_FAILED
q-086c61c0.js:1 QWIK ERROR TypeError: Failed to fetch dynamically imported module: [URL]/build/en/q-855adf5c.js
be @ q-086c61c0.js:1
7service-worker.js:5 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'ok')
    at service-worker.js:5:821
/build/q-af0597cf.js:1     Failed to load resource: net::ERR_FAILED
/build/q-3cc26691.js:1     Failed to load resource: net::ERR_FAILED
/build/q-798c2fd0.js:1     Failed to load resource: net::ERR_FAILED
/build/q-5a83f333.js:1     Failed to load resource: net::ERR_FAILED
/build/q-08ce32a4.js:1     Failed to load resource: net::ERR_FAILED
/build/q-4e0b3959.js:1     Failed to load resource: net::ERR_FAILED
/build/q-589c2a1e.js:1     Failed to load resource: net::ERR_FAILED

Here is the file service-worker.js thats throwing the error

This is where its throwing the error exactly for quick reference:

if(q(i,l))a(l);else return(c||t(i)).then(async y=>{y.ok&&await e.put(s,y.clone()),a(y)})})

Which i believe is here https://github.com/BuilderIO/qwik/blob/main/packages/qwik-city/runtime/src/service-worker/cached-fetch.ts#L65

Reproduction

N/A

Steps to reproduce

I honestly have no idea how to reproduce this, and Im not sure why this is happening on so many browsers except my own. I hope the error makes sense though

System Info

Latest chrome, latest OSX

Additional Information

This issue began after updating from commit 37321d2 to 648f55b

I suspect the issue has something to do with this PR #4548, just because the lines changed right above it

@DustinJSilk DustinJSilk added TYPE: bug Something isn't working STATUS-1: needs triage New issue which needs to be triaged labels Jun 22, 2023
@manucorporat
Copy link
Contributor

Disabled the whole thing from now, also getting weird errors! should be fixed in main

@manucorporat
Copy link
Contributor

Thank u so much for the help testing dev and latest! keep the issues coming!

@DustinJSilk
Copy link
Contributor Author

You鈥檙e welcome! Thanks for all the hard work!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants