# Intermittent 'Failed to load previous state' on @auth0-nextjs SDK on Login

**URL:** <https://community.auth0.com/t/intermittent-failed-to-load-previous-state-on-auth0-nextjs-sdk-on-login/89872>\
**Category:** Get Help\
**Tags:** nextjs\
**Created:** [September 1, 2022, 3:43pm UTC](https://community.auth0.com/t/intermittent-failed-to-load-previous-state-on-auth0-nextjs-sdk-on-login/89872 "2022-09-01T15:43:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterghdevwhite](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peterghdevwhite/32/34109_2.png) [@peterghdevwhite](https://community.auth0.com/u/peterghdevwhite)\
**Post date:** [September 1, 2022, 3:43pm UTC](https://community.auth0.com/t/intermittent-failed-to-load-previous-state-on-auth0-nextjs-sdk-on-login/89872/1 "2022-09-01T15:43:09Z")

</div>

- Which SDK this is regarding: @auth0-nextjs
- SDK Version: 1.9.1
- Platform Version: Next.js 12.2.0, Node 16.0.0
- Code Snippets/Error Messages/Supporting Details/Screenshots:

 ![WhatsApp Image 2022-09-01 at 12.28.29 PM](https://global.discourse-cdn.com/auth0/original/3X/c/e/cefda77e3f2cd6665e5b09339aee49e57336bf6c.jpeg)

I’m randomly getting this error when trying to log in into my app, it works fine most of the time but then it starts to give me this error for a few minutes or until I change users. It says ‘Failed to load previous state’. Also, I’ve found that this error happens a lot more in Microsoft Edge.

I’m using the @auth0-nextjs SDK on my Next.js App. My /api/[…auth0].ts is exactly the same as the tutorial and I’m using the Universal Login (with custom HTML).

Also checked the GitHub Issues but didn’t find one related to this. I tried debugging it for a while but as it is intermittent it is harder for me to figure out the root of the issue. Any help will be appreciated 🙂

---

<div class="post-metadata">

**Author:** ![alex.brett](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alex.brett/32/60157_2.png) [@alex.brett](https://community.auth0.com/u/alex.brett)\
**Post date:** [December 4, 2024, 7:26pm UTC](https://community.auth0.com/t/intermittent-failed-to-load-previous-state-on-auth0-nextjs-sdk-on-login/89872/4 "2024-12-04T19:26:25Z")

</div>

Hello @peterghdevwhite!

I found a [related article](https://community.auth0.com/t/failed-to-load-previous-state-for-first-time-sign-up/111037) with the same error.

TL;DR is that the login flow started directly with the `/login` endpoint instead of the `/authorize` endpoint which can cause the error. Please read through the other post and see if it is a similar fix.

I hope this helps!

Best,  
Alex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 18, 2024, 7:26pm UTC](https://community.auth0.com/t/intermittent-failed-to-load-previous-state-on-auth0-nextjs-sdk-on-login/89872/5 "2024-12-18T19:26:55Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
