Closed khol341 closed 2 years ago
cc @fastify/typescript
Please use esModuleInterop
for tsconfig.json
.
{
"compilerOptions": {
"esModuleInterop": true,
}
}
@climba03003 that does not fix the issue. Still getting the same error.
@climba03003 that does not fix the issue. Still getting the same error.
Please provide a repro for your issue. TypeScript behave differently depends on version, how you use and configuration.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Prerequisites
Fastify version
3.x
Plugin version
1.1.0
Node.js version
14.x
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10
Description
When trying to use this import in TS using the latest fastify-auth version:
, it actually doesn't work anymore and throws an error:
error TS2339: Property 'auth' does not exist on type 'FastifyInstance'.
This is not a problem when using the older version.I see a similar issue was posted for fastify-jwt here which still replicates.
Steps to Reproduce
Try to import plugin using named import in TypeScript.
Expected Behavior
Named import should work.