pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.25k stars 147 forks source link

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

Closed jaredhan418 closed 10 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 10 months ago

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

jaredhan418 commented 10 months ago

484 add PR here

mcollina commented 10 months ago

Fixed in #484