"next is not a function" using hook preParsing
woen4 opened this issue · comments
Kaio Woen commented
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
Latest
Plugin version
latest
Node.js version
18
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
20.04
Description
Using option on register middie plugin { hook: 'preParsing' }
, and in the middleware calling, next function, this emit a error next is not a function
Steps to Reproduce
Configure the middleware with option { hook: 'preParsing' }
, and call the next function inside middleware
Expected Behavior
Not emit errors
Matteo Collina commented
Thanks for reporting! It looks like you are trying to execute this module in the preParsing phase. It's not supported, exactly as you described it.
Would you like to send a Pull Request to address this issue? Remember to add unit tests.