We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/joshuaavalon/next-auth-es-bug
From the typescript definitions provided by next-auth, most of the functions are export via default.
next-auth
However, it is not the case. It is export at default.default
default.default
I try to wrap next-auth in a local package and import it in next.js
npm i
npm run build
npm run start
import { default as NextAuth } from "next-auth"; console.log(NextAuth);
It prints
{ default: [Getter], unstable_getServerSession: [Getter] }
It is expected to print
[Function: NextAuth]
The text was updated successfully, but these errors were encountered:
This is related to microsoft/TypeScript#22851.
When you compile to esnext module, esModuleInterop does not work.
esnext
esModuleInterop
My workaround is creating a CommonJs package, and export the default as named.
Sorry, something went wrong.
No branches or pull requests
Environment
Reproduction URL
https://github.com/joshuaavalon/next-auth-es-bug
Describe the issue
From the typescript definitions provided by
next-auth
, most of the functions are export via default.However, it is not the case. It is export at
default.default
I try to wrap next-auth in a local package and import it in next.js
How to reproduce
npm i
npm run build
npm run start
Expected behavior
It prints
It is expected to print
The text was updated successfully, but these errors were encountered: