-
Notifications
You must be signed in to change notification settings - Fork 900
Types issue with ESM setup #2120
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
Comments
I think this would do the trick:
|
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
|
So is this currently the only/correct way to use it without throwing TS errors?
|
I'm building for both CJS and ESM, so I had to do |
you can also manually but more people will end up here as that's not the default VSCode auto-import behavior |
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
The text was updated successfully, but these errors were encountered: