Skip to content

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

@ryuujo1573

Description

@ryuujo1573

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions