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

[bug] in the browser, pino.stdSerializers.errorWithCause does not serialize cause prop #2057

Open
jorroll opened this issue Oct 10, 2024 · 2 comments

Comments

@jorroll
Copy link

jorroll commented Oct 10, 2024

When using Pino.stdSerializers.errWithCause in the browser the "cause" property of errors are not, in fact, serialized.

Video demonstrating the behavior.
https://www.loom.com/share/916e9677c50946f99a5772adef18e992?sid=e775a176-ceed-48a1-a032-821f8af74314

The problem appears to be that, in the browser, a pino/browser.js module is being loaded with a different implementation of stdSerializers.errWithCause which doesn't actually serialize the cause property.

@jsumners
Copy link
Member

Please provide a minimal reproducible example, written in JavaScript. Doing so will help us diagnose your issue. It should be the bare minimum code needed to trigger the issue, and easily runnable without any changes or extra code.

You may use a GitHub repository to host the code if it is too much to fit in a code block (or two).

@jorroll
Copy link
Author

jorroll commented Oct 10, 2024

👍. Follow this link. Wait for stackblitz to initialize. Then open up the console and look at the output. Also, watch the video in the issue above.

https://stackblitz.com/edit/vitejs-vite-p3bgsf?file=src%2Fmain.ts

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

2 participants