N
Nuxt4mo ago
0xSherlock

Nitro plugins hooks not working

Hi there, im just looking for help to figure out why my server plugin close hook is not working, not even console logging or anything at all, nothing works. I've attached an image showing im properly using the hook in the defineNitroPlugin wrapper as well, all my code is within it.
No description
16 Replies
0xSherlock
0xSherlockOP4mo ago
Bump @moderator
manniL
manniL4mo ago
don't tag moderators to request help please. thanks
0xSherlock
0xSherlockOP4mo ago
Ok, so how long does it usually take to get a response?
manniL
manniL4mo ago
depends a lot on the question ideally, if you think it is a bug, provide a minimal reproduction and raise an issue
0xSherlock
0xSherlockOP4mo ago
Oh, I'm not sure if it's simple or not, seems it might be a bug or misuse It's just server plugin that doesn't run anything in close hook when I stop the nitro server
manniL
manniL4mo ago
I'd try a plain nitro reproduction and see if it doesn't work there
0xSherlock
0xSherlockOP4mo ago
Okay I'll try that
manniL
manniL4mo ago
if it does, raise an issue in Nuxt with a reproduciton (can be as simple as the example here -> https://nitro.unjs.io/guide/plugins#graceful-shutdown)
Plugins - Nitro
Use plugins to extend Nitro's runtime behavior.
manniL
manniL4mo ago
if it also doesn't work in nitro, e.g. with the example above, open an issue there 👍
0xSherlock
0xSherlockOP4mo ago
Ok thanks Alex I'll give it a shot
manniL
manniL4mo ago
no problem! Best of success 🙏
0xSherlock
0xSherlockOP4mo ago
GitHub
fix(nuxt): call close hook in dev by huang-julien · Pull Request #2...
🔗 Linked issue resolve #28188 📚 Description This PR call the close hook when closing the process in dev
0xSherlock
0xSherlockOP4mo ago
This seems like it may be it? And seems they gave up on it Problem is the close hook doesn't trigger on my digitalocean vps either which is not windows
manniL
manniL4mo ago
that should only be in dev mode
danielroe
danielroe4mo ago
It also didn’t work The issue is that node didn’t call async hooks before exiting.
0xSherlock
0xSherlockOP4mo ago
do you know how to fix it?
Want results from more Discord servers?
Add your server