-
Notifications
You must be signed in to change notification settings - Fork 1k
Issue with pino/thread-stream when packaged #1419
Comments
I think I'm seeing the same issuee. The differences for me are:
Everything works fine if I don't initialise pino with a transport.
|
To make pino working add this to package.json:
Why? Pino uses worker threads starting from v7, the problem is that to require worker threads it don't uses |
Thanks a lot to vercel/pkg#1419 !
Thanks a lot to vercel/pkg#1419 !
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label |
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit. |
For future reference, instead of defining the transport: {
target: 'pino-pretty',
options: {
colorize: true
}
} I pipe it into the commandline-utility: node www.js | yarn pino-pretty This works, and this weird error is gone |
In case anyone is having that issue after updating to pino 7.8.1, I got pkg working again with the following config:
|
@meppig You configuration has an error:
should be
otherwise it will strip out also leading
|
@robertsLando Thanks for your follow-up. |
Yep I'm on Linux! It could be that so because paths are different in such cases. Thanks to you, will try to keep this answer updated as pino is upgraded :) |
What version of pkg are you using?
5.4.1
What version of Node.js are you using?
14.17.6
What operating system are you using?
macOS
What CPU architecture are you using?
Intel Core i7 (2019 macbook pro)
What Node versions, OSs and CPU architectures are you building for?
"linux", "macos", "windows" (default node version above, no other params)
Describe the Bug
There seems to be an issue when packaging and using the transport feature of the pino logging library
It seems to originate from pino, a logging library i'm using, but i think the underlying problem comes from the thread-stream library.
I tried manually adding '/node_modules/thread-stream/lib/worker.js' to 'scripts' in package.json, however then this error shows up:
When running the project through node it works as expected, no errors.
Also when running the pino logger without the transport feature.
Expected Behavior
Not to throw an error.
To Reproduce
Can be reproduced by packaging a script that uses the pino library, initializes a logger instance, and logs a message.
The error appears when using the logger instance, for example:
The text was updated successfully, but these errors were encountered: