-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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(safari): POST requests getting blocked with 504 by Service Worker #37133
Comments
This needs further investigation. Note that it might be related to the SW's stripping off request headers (see #24227 for more info). |
I am also getting random 504 errors on some HTTP Client API GET requests, only on Safari. I never thought it might be the Service Worker... Will attempt to add the Update: : Adding Note: In the Safari Dev Console the erroneous requests were showing as related to the Service Worker. |
I am encountering the same issue, which is a big problem because currently |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I think this needs a more convenient way since not all SDK's allow modifying/adding query parameters, e.g. Sentry does no longer and Google Analytics for events as well. Can we not just have a |
Hi guys, this seems the same as #53438
Anyone has found a better solution? Hope this can help you. |
I also have the same problem. Google Tag Manager is not working out box with Service workers on iPhone. GTM requests are blocked with 504 response. const urlsToBypass = [
'www.googletagmanager.com',
'.google-analytics.com',
];
// Catch `fetch` events and prevent specific ones from propagating to the Angular SW.
self.addEventListener('fetch', evt => {
try {
const url = evt.request.url.toLowerCase();
if (urlsToBypass.some(part => url.includes(part))) {
evt.stopImmediatePropagation();
}
} catch (error) { }
});
// Import the Angular SW to do the heavy-lifting.
self.importScripts('./ngsw-worker.js'); I don't like this because I would prefer to use original ngsw-worker.js. Best solution will be to investigate why this scripts are blocked on iPhone and if there is way to solve it. Other solution is that ngsw-worker.js' supports some kind of options including list of urls to bypass. |
🐞 bug report
Affected Package
@angular/service-worker
Is this a regression?
I don't know if this has even worked properly in Safari, but it's supposed to be production ready.
Description
Service Workers shouldn't block POST requests AFAIK, but that's happening on Safari
Version 13.1 (15609.1.20.111.8)
on macOS Catalina10.15.4 (19E287)
.🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
Angular Version:
10.0.0-next.5
Anything else relevant?
I'm also seeing this on my site when using LogRocket (another kind of analytics service), but the Headers it complains about are different:
The text was updated successfully, but these errors were encountered: