Skip to content
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

[bug] logger.setBindings undefined when using esm exported pino #2021

Open
ryuujo1573 opened this issue Aug 5, 2024 · 2 comments
Open

[bug] logger.setBindings undefined when using esm exported pino #2021

ryuujo1573 opened this issue Aug 5, 2024 · 2 comments
Labels

Comments

@ryuujo1573
Copy link

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.

@mcollina
Copy link
Member

mcollina commented Aug 6, 2024

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@mcollina mcollina added the bug label Aug 6, 2024
@mcollina
Copy link
Member

mcollina commented Aug 6, 2024

It this a JS or a TS bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants