-
Notifications
You must be signed in to change notification settings - Fork 12k
New CLI app doesn't register service worker if socket.io-client is used #9098
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
Comments
An update to this: it works fine if I initialize the socket with
Even if I setTimeout for several seconds before trying to connect, it appears to wait for the socket to be initialized and then subsequently doesn't load |
maybe this is related to angular #20970, the zone does not get stable because the autoConnect of socket.io is doing a setInterval (check connection, reconnect if broken)? |
I found this workaround:
|
I think this is the same as #9021. If this is still a problem can you follow up there please? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Uh oh!
There was an error while loading. Please reload this page.
Versions
Repro steps
ng new ngsw-test --service-worker
)npm install socket.io-client --save
andnpm install "@types/socket.io-client" --save-dev
ng build --prod
, then runhttp-server .\dist
Observed behavior
The new CLI app doesn't register the service worker (if the socket initialization in
app.component.ts
is commented out it works fine). No errors in the console (other than connection refused if the socket server isn't running. I get the same behavior if it connects fine though).Desired behavior
Register the service worker even when a socket is being used.
Mention any other details that might be useful (optional)
The text was updated successfully, but these errors were encountered: