Cannot override specific hooks once the preset already registered the same hook
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
Discussed in https://github.com/unjs/nitro/discussions/1376
Originally posted by igorjacauna July 2, 2023
I would like to use the compiled hook but if I use a preset, my hook overwrites the preset hook. So, the preset hook is not called, only my hook configured in nitro.options.hooks.compiled
Repro: https://github.com/igorjacauna/nuxt-nitro-hook
More info about reproduction in README
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction linked in the issue and its README, then trace how nitro.options.hooks.compiled is handled when a preset has already registered that hook. Confirm the current behavior and identify the expected composition where both hooks are called; done means the preset hook and the user-configured hook both run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100