rainbowkit
rainbowkit copied to clipboard
[bug] `RainbowKitSiweNextAuthProvider` not working with NextAuth.js v5
Is there an existing issue for this?
- [X] I have searched the existing issues
RainbowKit Version
1.3.2
wagmi Version
1.4.12
Current Behavior
I'm thrown a runtime error when I try to use RainbowKitSiweNextAuthProvider
with NextAuth.js v5:
The issue has appeared upon migration to v5. (it worked on v4)
Unwrapping RainbowKitProvider
from RainbowKitSiweNextAuthProvider
resolves the issue even though I'm not able to leverage Sign-in with Ethereum (siwe) then.
@components/RainbowKit.tsx:
@/app/layout.tsx:
My dependencies:
- @rainbow-me/rainbowkit: 1.3.2
- @rainbow-me/rainbowkit-siwe-next-auth: 0.3.4
- next-auth: 5.0.0-beta.4
- siwe: 2.1.4
- viem: 1.21.3
- wagmi: 1.4.12
Expected Behavior
No response
Steps To Reproduce
No response
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
No response
Anything else?
No response
I think it is not compatible with next-auth v5 yet https://github.com/rainbow-me/rainbowkit/releases/tag/%40rainbow-me%2Frainbowkit-siwe-next-auth%400.3.3
@edxeth Currently the peer version is not supported and you should receive a package manager warning. Feel free to ping here when next-auth v5 is out of beta, and we can work on adding support!
@c0rdeiro I see, thanks for the reference!
@DanielSinclair I will, looking forward to that :)
PS: out of curiosity, wagmi v2 and viem v2 were released so when can we expect RainbowKit to support the new version?
@edxeth The wagmi v2 and viem v2 support will be released very soon, but we do have a beta version that you can try out. Feel free to look at the migration guide here: https://beta.rainbowkit.com/guides/rainbowkit-wagmi-v2
Let me know if you find any issues 👍
@KosmosKey with that will the rainbowkit-siwe-next-auth
dependency be upgraded to [email protected]
?
@KosmosKey with that will the
rainbowkit-siwe-next-auth
dependency be upgraded to[email protected]
?
Yes that's correct. RainbowKit will be upgraded to 2.x
. Just make sure to update @rainbow-me/rainbowkit-siwe-next-auth
to the latest version 0.4.x
once it's out.
@edxeth Are you still facing this issue ? If yes do you have a small code example i can look at ?
@KosmosKey is Rainbowkit v2 now supporting Next-Auth v5 (still in beta)?
@KosmosKey is Rainbowkit v2 now supporting Next-Auth v5 (still in beta)?
We don't support beta yet. Are you able to use the latest non beta version for now and when the v5 launches we'll make sure to update it with RainbowKit.
Auth.js seems to be approaching a production release of v5 soon, so we will begin working on this. We are also evaluating other improvements to the Authentication/SIWE flow. Do you use SIWE alongside other auth methods in your next-auth configuration, or would you prefer if most of the boilerplate implementation is handled within RainbowKit's adapter package? I think we have the opportunity to make this much simpler for devs! Feedback or ideas are appreciated.
@DanielSinclair Although next auth does require a significant amount of boilerplate I think the priority should move away from siwe lib since it requires ethers still I see you're working here #1997 on moving to the new viem siwe which already makes me very happy. Keep up the great work