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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(workbox): add additional details for uncaught errors and fix chromium CORS #417

Merged
merged 5 commits into from
Dec 20, 2020

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Dec 20, 2020

When opening chromium devtools on first load, it makes a request that violates Request.cache spec: (chromium#823392)

The "only-if-cached" mode can only be used if the request's mode is "same-origin". Cached redirects will be followed if the request's redirect property is "follow" and the redirects do not violate the "same-origin" mode. (mdn)

Solution is to rewrite workbox request by detecting this condition and change cache option to default


Since there might be more causes for uncaught errors (#176 (comment)) this PR is also adding more context to production errors with full context:

Before: (production - debug disabled):

image

After: (production)

image

For more context, one may still enable production debugging in nuxt.config:

{
  pwa: {
     workbox: { debug: true }
  }
}

This PR resolves #176 with best efforts. IMPORTANT: Disabling clientsClaim as workaround with other defaults is NOT SAFE and may cause caching problems and if you was doing it before, should keep it with default value

@codecov
Copy link

codecov bot commented Dec 20, 2020

Codecov Report

Merging #417 (dcb519f) into master (be2bc76) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #417   +/-   ##
=======================================
  Coverage   85.28%   85.28%           
=======================================
  Files           9        9           
  Lines         367      367           
  Branches      122      122           
=======================================
  Hits          313      313           
  Misses         54       54           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be2bc76...dcb519f. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workbox strategies uncaught no-response
1 participant