You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could very well be wrong on this, but it seems like the module augmentation done on the Request object is not implemented properly.
I found myself on a journey learning about Module Augmentation recently that was sparked by what you guys are doing in this project. I noticed when trying to use the logger decorator in hapi plugins written in typescript, my IDE was failing to recognize the property was added on the Request object.
Through testing, I found that the logger worked as expected, so this just meant that there was something wrong with the type resolution.
While working with writing my own decorators in typescript, and making sure the Module Augmentation got picked up correctly, I stumbled across this on stack overflow, and realized why the augmented type wasn't being resolved when I tried to use the one declared here in hapi-pino. So I figured I'd share!
Also, I never used the server.logger, decorator, but for all I know it could be in the same boat.
TLDR
The module augmentation on the Request object, declared in this project's types, needs to be adjusted in order for it to be resolved correctly in typescript projects.
I could very well be wrong on this, but it seems like the module augmentation done on the Request object is not implemented properly.
I found myself on a journey learning about Module Augmentation recently that was sparked by what you guys are doing in this project. I noticed when trying to use the
logger
decorator in hapi plugins written in typescript, my IDE was failing to recognize the property was added on theRequest
object.Through testing, I found that the logger worked as expected, so this just meant that there was something wrong with the type resolution.
While working with writing my own decorators in typescript, and making sure the Module Augmentation got picked up correctly, I stumbled across this on stack overflow, and realized why the augmented type wasn't being resolved when I tried to use the one declared here in hapi-pino. So I figured I'd share!
Also, I never used the
server.logger
, decorator, but for all I know it could be in the same boat.TLDR
The module augmentation on the Request object, declared in this project's types, needs to be adjusted in order for it to be resolved correctly in typescript projects.
This
Should look like this
The text was updated successfully, but these errors were encountered: