pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.27k stars 150 forks source link

Can't use default when dynamic import for TS module resolution: node16 #473

Closed jaredhan418 closed 11 months ago

jaredhan418 commented 1 year ago
//partial tsconfig
  "compilerOptions": {
    "moduleResolution": "Node16",
    "module": "Node16",
    "target": "ES2022",
  },
ts-node16

TS always throw error cuz default function not as expect when import pino-pretty in dynamic way.

jaredhan418 commented 1 year ago

suggest, add one line module.exports.PinoPretty= build below to match current index.d.ts https://github.com/pinojs/pino-pretty/blob/41fdd31b66506f862ad4ce3ca8a791408522bf8d/index.js#L170

mcollina commented 11 months ago

Thanks for reporting! Would you like to send a Pull Request to address this issue?

jaredhan418 commented 11 months ago

484 add PR here

mcollina commented 11 months ago

Fixed in #484