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

Type errors when using log.child() #1840

Closed
wolfy1339 opened this issue Oct 29, 2023 · 1 comment · Fixed by #1847
Closed

Type errors when using log.child() #1840

wolfy1339 opened this issue Oct 29, 2023 · 1 comment · Fixed by #1847

Comments

@wolfy1339
Copy link
Contributor

When using the Logger type exported in a function to get a child logger, I am getting a TypeScript error because the redactOptions is not exported

Return type of exported function has or is using name 'redactOptions' from external module "node_modules/pino/pino" but cannot be named.
import type { type Logger } from "pino";

function foo(log: Logger) {
   return log.child({ name: "foo" })
}
wolfy1339 added a commit to wolfy1339/pino that referenced this issue Nov 4, 2023
Because it is used elsewhere in an exported type, it needs to be exported as well or else TypeScript throws an error

Fixes pinojs#1840
mcollina pushed a commit that referenced this issue Nov 15, 2023
Because it is used elsewhere in an exported type, it needs to be exported as well or else TypeScript throws an error

Fixes #1840
Copy link

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 Dec 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant