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

Command never outputs anything #50

Open
sazzer opened this issue Aug 21, 2022 · 4 comments
Open

Command never outputs anything #50

sazzer opened this issue Aug 21, 2022 · 4 comments

Comments

@sazzer
Copy link

sazzer commented Aug 21, 2022

I've been playing with this because it seems incredibly useful, and it doesn't work. It never outputs anything :(

It seems that the problem is down to require.main === module in index.js. This always returns false for me, no matter what.

This is on Node v18.7.0, and I've been running the tool with both npx pino-filter and node ./node_modules/.bin/pino-filter. If I change that conditional to always be true then it works great, but for some reason with it as-is it doesn't work :(

Cheers

@jsumners
Copy link
Member

I recommend not using npx. I have no idea how that tool loads the package. Also, we currently do not own the code on npmjs.com, so do not use that published package.

@juanpaco
Copy link

juanpaco commented Nov 8, 2022

@sazzer , are you running with modules (import and friends)?

It looks like require.main isn't available on modules: https://stackoverflow.com/a/60309682/322418. That could be why that's always false.

My co-workers and I are seeing the same issue you describe, and we're using modules.

@jsumners
Copy link
Member

jsumners commented Nov 8, 2022

Again: we have not published this module to npm. We cannot guarantee what code is being pulled from npmjs.com.

@jsumners
Copy link
Member

We finally gained publishing rights to the package on npm. I have published v2, but nothing in it has changed except for dependency updates.

A PR to solve this issue would be welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants