-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fastify-auth0-verify with Typescript #354
Comments
Can you provide a repro? |
@ilteoood I try to provide a repro, and it's so strange, there aren't any errors. @simoneb LGTM Maybe there are some library conflict? |
Can you show us the error? |
import fastifyAuth0Verifiy from "fastify-auth0-verify"; app.register(fastifyAuth0Verifiy, { this is the line and the error is https://pastebin.com/WeN1hbPm |
The Problem@lleonori This is a problem with your typescript configuration and its type compatibility with fastify-auth0-verify as you are using While fastify-auth0-verify is setup for fastify-auth0-verify/tsconfig.json Lines 3 to 4 in f5f98a2
The SolutionThere are two ways that I can think of to solve this problem if I don't want to rewrite this package in
|
@faizplus shall our code not be compatible with a standard TS setup instead? |
@simoneb definitely the code should be compatible, I will try to find a way to make it work. I have provided quick solutions only. |
What about using tsup to compile to both esm and cjs? |
I'm sure there must be a way to expose CJS code in a way that's usable from ESM/TS without much effort. |
Fixes: #354 Updated module export statements & type declarations inspired from fastify-jwt
I use this plugin with Typescript, and when I register it:
the application still run, but typescript notify an error:
https://pastebin.com/WeN1hbPm
The export default is present inside the index.d.ts and I use it:
export default fastifyAuth0Verify
The text was updated successfully, but these errors were encountered: