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
[Config] pinoWillSendConfig leads to configuration mutation #1963
Comments
As a workaround, downgrading to 8.20 (with {
"dependencies": {
"pino": "8.20",
},
"overrides": {
"fastify": {
"pino": "8.20"
}
}
}
|
nioc
changed the title
[Fastify/Pino pretty] Error: Can not update runtime configuration property: "pinoWillSendConfig". Configuration objects are immutable unless ALLOW_CONFIG_MUTATIONS is set.
[Fastify/Config/Pino pretty] pinoWillSendConfig leads to configuration mutation
May 4, 2024
Reproduced with simpler code: import pino, { LoggerOptions } from 'pino'
import config from 'config'
// this does not work:
const loggerConfig = config.get('api.logger') as LoggerOptions
// this works but is ugly:
const loggerConfigWorkaround = JSON.parse(JSON.stringify(config.get('api.logger'))) as LoggerOptions
export const logger = pino({
...loggerConfig,
})
|
nioc
changed the title
[Fastify/Config/Pino pretty] pinoWillSendConfig leads to configuration mutation
[Config] pinoWillSendConfig leads to configuration mutation
May 5, 2024
Encountered same issue, thank you for the solution @nioc |
Thanks @mcollina for the fix ; now I'm waiting for testing it in 9.2.0 (or 9.1.1) release 😉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I just upgrade from pino 8.19.0 to 8.21.0 and my code encounter this error:
Here is my code on src/api/index.ts:
And the config:
I try to add a attribute in both
logger
andlogger.transport.options
, nothing changes... So the logger received this config object:It seems it is #1930 which add this, can you help me?
The text was updated successfully, but these errors were encountered: