Coder Social home page Coder Social logo

Comments (7)

RustedBuckett avatar RustedBuckett commented on June 8, 2024 2

I am getting six requests to the login and logout endpoints. This isn't just on dev but also when deployed to vercel in prod env (getting four on prod env). Strict mode is on in dev env.

from next-firebase-auth.

thesatyam05 avatar thesatyam05 commented on June 8, 2024 1

I had the same issue, but having this issue on a development server is not a problem until you experience the same thing with the optimized build. The reason behind you experiencing this issue might be related with strict mode ( causing two renders ) and using useEffect.
I hope this helps. 😊

from next-firebase-auth.

lazycipher avatar lazycipher commented on June 8, 2024

@yosipy, is this happening locally only?
Can you check if strictmode is active or not? https://nextjs.org/docs/pages/api-reference/next-config-js/reactStrictMode

from next-firebase-auth.

lazycipher avatar lazycipher commented on June 8, 2024

This is the deployed link sent by @yosipy

Screenshot 2023-05-16 at 10 01 10 AM

@RustedBuckett, it calls 2 times in dev if strict mode is on. But not sure why 6. Can I get any deployment or any link to code so that I can try to reproduce?

from next-firebase-auth.

kmjennison avatar kmjennison commented on June 8, 2024

Thanks for the issue. Could this be related to hot reloads or other dev-related rerenders?

#424 would serve as a band-aid fix, but it would be good to know the underlying cause here. Help wanted!

from next-firebase-auth.

kmjennison avatar kmjennison commented on June 8, 2024

Closing this as an expected behavior of React's strict mode:

To help you find accidentally impure code, Strict Mode calls some of your functions (only the ones that should be pure) twice in development.

However, implementing #424 would remove this behavior in development, too.

from next-firebase-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.