oidc-client
oidc-client copied to clipboard
Service worker keep alive failed to fetch logs
Hi,
Is it possible please to remove the following console.logs and just swallow / ignore it silently instead? https://github.com/AxaGuilDEv/react-oidc/blob/3ec7132a7810a5276b0fc8eaffe1573523fd5534/packages/react/src/oidc/vanilla/initWorker.ts#L44
https://github.com/AxaGuilDEv/react-oidc/blob/3ec7132a7810a5276b0fc8eaffe1573523fd5534/packages/react/src/oidc/vanilla/initWorker.ts#L46
They cause a lot of noise ! :(
Thanks
Or this could be behind a flag...
hi @beanovar and @ronildo,
yearh, I'am agree : A flag would be a good solution. The issue is discussed also here #862. I have a problem, chrome is loggin an error even if we do not set up log. I will be on holiday for 2 weeks. May you wait a little for it ?
Thank you for your issue @beanovar .
Hi @ronildo , @beanovar , in the lastest chrome and edge version, i do not have this problem anymore. I do not know why, i think they have made an update on chromiom side.
I had similar issues with log errors "failed to fetch /OidcKeepAliveServiceWorker.json"
Inside the serviceWorker, I noticed the hanleFetch function was responding to the event via keepAliveAsync however keepAliveAsync was not being awaited. Once awaited was added, the fetch error was resolved. Unsure if this is best practice, but it did silence the error logs.
const handleFetch = async (event) => {
const originalRequest = event.request;
const url = originalRequest.url;
if (originalRequest.url.includes(keepAliveJsonFilename)) {
event.respondWith(await keepAliveAsync(event)); // 👈 await added here
return;
}
// .....
}
@axa-fr/react-oidc package version 6.14.10
Hi @guillaume-chervet @bkershaw We currently have a similar issue (I tried using different browsers), when I do "Empty Cache and Hard Reload" so:
- It ends up with 404 locally
- Retrieves index.html while running in Azure (behind NGINX and Docker)
- Works as expected if I just refresh the page without hard reload afterwards
It really seems that "OidcKeepAliveServiceWorker.json" request isn't handled by the library upon hard refresh Is there anything that could potentially help us?