You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: