Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pino with transports not compatible with pkg #1237

Closed
rokku-x opened this issue Nov 21, 2021 · 4 comments · Fixed by #1493 or pinojs/thread-stream#95
Closed

Pino with transports not compatible with pkg #1237

rokku-x opened this issue Nov 21, 2021 · 4 comments · Fixed by #1493 or pinojs/thread-stream#95

Comments

@rokku-x
Copy link

rokku-x commented Nov 21, 2021

I have included all the worker scripts in scripts list in pkg.
But I still can't run the app when packaged due to the incompatibility of the real-require which is part of the pinojs modules

This is the error I get:

TypeError: Invalid host defined options
at eval (eval at (C:\snapshot\test\node_modules\real-require\src\index.js:4:20), :3:1)
at start (C:\snapshot\test\node_modules\thread-stream\lib\worker.js:21:17)
at Object. (C:\snapshot\test\node_modules\thread-stream\lib\worker.js:67:1)

@mcollina
Copy link
Member

I would recommend you to take a look at https://github.com/pinojs/pino-webpack-plugin and how it works.

I think you'll need to do something similar for pkg. Unfortunately we do not have the bandwidth to explore how to do it for every bundler out there.

@rokku-x
Copy link
Author

rokku-x commented Dec 7, 2021

I already have made a fix. It involves two of the modules used in pino. Will post a PR soon.

@rokku-x
Copy link
Author

rokku-x commented Dec 7, 2021

@mcollina I made fixes with real-require, thread-stream, and this.

The patches with real-require is needed because loading real-require module itself crashes the app immediately.

I do not know if the fix I made will break something.

Please Help Me check. Thank You.

@github-actions
Copy link

github-actions bot commented Sep 4, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants