-
Notifications
You must be signed in to change notification settings - Fork 47
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
fastifyPassport.initialize is not a function #36
Comments
Thanks for the bug report. Super weird. Which version of |
Hi @airhorns |
Ok, thanks, and which typescript version are you running on? |
Hi @airhorns |
Oh whoops right, |
@fox1t I think but am not sure that this is related to #6 where I also don't yet understand why this is working for some people if requiring is broken like this. |
@airhorns yeah I am not using any packager. |
Hi! My study project has |
AS far as I know, esModuleInterop should not create this problem. However, it is worth spending some time to dig this down. |
Looking better on how we export this https://github.com/fastify/fastify-passport/blob/main/src/index.ts#L5 shows that we are just exporting a I can make a PR that uses a ".js bridge file" to get rid of that |
Hi @fox1t , You could go ahead and use below |
Speaking of this, here you are in the TS context with This should just work! |
Can you try to import as |
That makes sense why it wasn't broken for some and broken for others, but, we should probably make it work by default for CJS contexts right? |
Yes, there are 2 viable solutions:
|
🐛 Bug Report
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Error FastifyPassport.initialize is not a function
Expected behavior
A clear and concise description of what you expected to happen.
Your Environment
The text was updated successfully, but these errors were encountered: