pinojs / pino-pretty

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

Remove reliance on worker_thread to enable working with wrangler (CF worker) #488

Closed casertap closed 7 months ago

casertap commented 7 months ago

worker_thread being nodejs specific this library cannot work with wrangler (even with nodejs_compat = true)

[wrangler:inf] Ready on http://localhost:8787
✘ [ERROR] Could not resolve "worker_threads"

    ../../../node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js:5:33:
      5 │ const { isMainThread } = require('worker_threads')

Not really sure why something that make pino pretty need to rely so heavily on a nodejs package. Is there another way? Thanks

mcollina commented 7 months ago

Unfortunately we don't support wrangler or cloudflare workers, and we don't have the bandwidth to. I suspect that's not the only issue you'd get when using this module there.

Not really sure why something that make pino pretty need to rely so heavily on a nodejs package. Is there another way?

Take a look for yourself and let us know.