-
Notifications
You must be signed in to change notification settings - Fork 167
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
Pino object logger option gets cloned after #568 #574
Comments
Thanks for reporting Let me check what I broke |
Would be great if this can get some attention, this was really hard to debug and a huge head scratcher while I tried to figure out why my logger was no longer working as expected in production. |
Great, thanks for your response. Like @jordanebelanger I have a custom logger defined in my options in app.js, and no logs were being generated anymore after an update of fastify-cli. As mentioned by the TS, the issue is in version 5.6.1 and above. On 5.6.0 it is still working. The workaround for now is to stick to 5.6.0. Please let me know if there's any more information you need. |
I think we should explore a bit the If we check the obj prototype, we should be able to understand if we must clone it or not |
Thanks, what type of objects do you think we should clone? |
Actually, that callback isn't being called in this case because it goes on this line, where it is directly being merged into target. In my example above, |
Offff. So I'm stuck with fastify-cli@5.6.0 for the time being... |
I used the logging-module as a workaround which is also annoying as I need to craft a separate file and compile it specially to share state with the main bundle and it also doesn't support ESM (#760) I think the problem might be that |
Hi, any update on it? I've tried versions 5.9, 6, and 7 of the fastifly-cli, but I'm still encountering the following error:
|
I guess the easiest way is for a volunteer to send a PR to fix. |
Prerequisites
Fastify version
4.10.2
Plugin version
5.7.0
Node.js version
18.12.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
13.0.1
Description
After #568 was merged, the new behavior of
deepmerge
clone theoptions
object and tries to clone any instance of Pino we pass as option, modifying it into a simple object so that all the Pino settings are lost.Steps to Reproduce
Given the following fastify startup module:
When using fastify-cli like this:
I get this output:
Expected Behavior
The expected output would be something like this instead:
I would tend to think that
deepmerge
should be modified in order to clone by reference any type of object that is not a plain JS object, but I'd appreciate any feedback in order to try and provide a patch for this.The text was updated successfully, but these errors were encountered: