Closed budasnorbi closed 2 years ago
hey @budasnorbi thanks for the detailed issue.
As per react, their strict mode should call a few react hooks twice during development mode to catch unexpected side effects. This list doesn't include useEffect
which is what we use to make a call to the backend to send the email verification email. Also this is only for development builds.
However, in nextjs, even useEffect
is called twice - I'm not sure why. And again, this happens only in development mode.
Maybe try react strict mode on and make a production build - does it still send the email twice?
Yes, i can confirm that. Strict mode works with production build. Got one mail.
Sounds good. So i am closing this issue.
Hey, I would like to report an issue about reactStrictMode: true at Next.js.
I got this setting default to true when generated the project. When i successfully signed up i got two email address verification emails. After a suggestion to change reactStrictMode to false it worked the way it should and i only got one mail.
I used the EmailPassword recipe.
Framework: Next.js
Pages
auth/[[...path]].tsx:
_app.tsx
index.ts
After enabling troubleshoot on the supertokens backend SDK I got theese logs: