-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Nuxt hook "listen" is not firing #149
Comments
I'm guessing this line needs the callHook? |
(Related: nuxt/nuxt#11786). Because Nuxt is build-time only, there is nothing to call these server hooks. Instead we will implement via the ability to extend Nitro itself. |
Indeed nuxt is build-time only and listener server is initiated before nuxt via nuxi cli. Still would be nice if we can fake hook for backward compatibility or possible edge case uses. |
Fwiw, some background on this issue: my use case was waiting for the listen hook to fire so that I could re-use nuxt's server instance. Specifically, for socket.io. This way socket.io and nuxt could share the same port without requiring additional configuration. However, for the time being, I decided to just keep the two separate (on separate ports). The more I think about it, it may be better design for Nuxt to treat it's own server instance as private and to remove the listen hook from the type definitions so people don't attempt to use the hook. It's properties though, like current host and port, may still be useful for developers to access. |
@danielroe Is there any way to set keepaliveTimeout etc for Node.js server in |
@richardeschloss I have a similar problem, I want to provided prometheus metrics from the application on a separate port. What is the event that you are listening to in order to open socket.io connection? |
I'm listening for |
Environment
Node LTS (16) on Linux / nuxt-bridge / nuxt-edge / vite
Reproduction
The nuxt "listen" hook does not seem to be firing. Please add it back in if it was deleted.
Describe the bug
The nuxt "listen" hook does not seem to be firing. Please add it back in if it was deleted.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: