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

Service Worker Error #858

Closed
ghost opened this issue Mar 27, 2016 · 3 comments
Closed

Service Worker Error #858

ghost opened this issue Mar 27, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 27, 2016

Hello,

Getting lots of errors all related to CORS. After 3 days of looking for the problem, I have found the problem to be this header:

< meta http -equiv =" Accept-CH" content=" DPR, Viewport-Width, Width" / >

Not sure why but it does not work with service worker and produces many errors. For example I was using sw-toolbox and linking to some javascript files on cdnjs.com and some fonts via google fonts api, both started displaying messages of error 405 and cors problems.

e.g.

Failed to load resource: the server responded with a status of 405 (Not Allowed)

Fetch API cannot load https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.6/hammer.min.js. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://example.com' is therefore not allowed access. The response had HTTP status code 405. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

The FetchEvent for "https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.6/hammer.min.js" resulted in a network error response: the promise was rejected.

undefined:1 Uncaught (in promise) TypeError: Failed to fetch(…)

When I remove this meta header all problems disappear and when add it to the head section errors come back.

Conclusion: This header and service worker do not work together and give false errors. Also I am using Google Chrome version 51.0.2687.0 dev-m (64-bit) and Google Canary Version 51.0.2692.0 canary (64-bit). Both give these false errors with this meta header.

@wanderview
Copy link
Member

Can you test with Firefox to see if you get the same error?

@ghost
Copy link
Author

ghost commented Mar 28, 2016

Hi Firefox is fine seems like its Google side that's the problem.

@jakearchibald
Copy link
Contributor

I believe this is the issue https://bugs.chromium.org/p/chromium/issues/detail?id=599704

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

No branches or pull requests

2 participants