pino
pino copied to clipboard
[bug] logger.`setBindings` undefined when using esm exported pino
trafficstars
Replica:
import { pino } from "pino"
export const logger = pino({
browser: {
serialize: true,
asObject: true,
},
customLevels: {
d: 1,
i: 2,
w: 3,
// ...
}
})
produces TypeError: logger.setBindings is not a function
Alternative:
- import { pino } from "pino"
+ import pino from "pino"
Use default export fixes the problem for now.
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
It this a JS or a TS bug?