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

Types issue with ESM setup #2120

Open
iamchathu opened this issue Jan 23, 2025 · 3 comments
Open

Types issue with ESM setup #2120

iamchathu opened this issue Jan 23, 2025 · 3 comments

Comments

@iamchathu
Copy link

The types seems broken in ESM Typescript setup with module resolution set to "node16".

Pino is commonjs and normally should work with the project without issues.

Here is the reproduction minimal setup.

https://stackblitz.com/edit/stackblitz-starters-kuphd3r7?file=tsconfig.json,src%2Findex.ts

@mcollina
Copy link
Member

I think this would do the trick:

import pino from 'pino';

const logger = pino({});

@iamchathu
Copy link
Author

Still the error is the same

Type 'typeof import("/home/projects/stackblitz-starters-kuphd3r7/node_modules/pino/pino")' has no call signatures.

3 const logger = pino({});
                 ~~~~


Found 1 error in src/index.ts:3

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