stack-auth / stack

Open-source Auth0/Clerk alternative
https://stack-auth.com
Other
4.07k stars 260 forks source link

Account Settings Email Page Suspense Issue #335

Open ralf-boltshauser opened 1 week ago

ralf-boltshauser commented 1 week ago

In the Account Settings handler, when switching to the email tab, the nav is gone because a suspense boundary is triggered on level too high. (That's at least my assumption of how it looks)

N2D4 commented 18 hours ago

Do you want to work on this? @ralf-boltshauser

ralf-boltshauser commented 17 hours ago

yes sure, currently I am actually debugging some bigger issue that actually might be related to stack-auth and be the fundament of this. I will come back later and maybe delete / merge this issue into the larger thing.

I figured out, that in stack-auth projects (need to confirm) when I execute a server action the loading.tsx is retriggered. Whereas in normal nextjs applications the loading.tsx only triggered in the first render and then afterwards it just updates the state.

As soon as I have narrowed down that thing I will update the issue and take a look at it!

fomalhautb commented 17 hours ago

yes sure, currently I am actually debugging some bigger issue that actually might be related to stack-auth and be the fundament of this. I will come back later and maybe delete / merge this issue into the larger thing.

I figured out, that in stack-auth projects (need to confirm) when I execute a server action the loading.tsx is retriggered. Whereas in normal nextjs applications the loading.tsx only triggered in the first render and then afterwards it just updates the state.

As soon as I have narrowed down that thing I will update the issue and take a look at it!

This might be because of this https://github.com/vercel/next.js/issues/50163

Next.js 14 automatically refreshes the page when setting cookies in server actions. However, based on my testing, Next.js 15 doesn't seem to have this problem. So, if it is not too hard, you can upgrade to Next.js 15, and the problem should be solved. We will also probably try to come up with something to workaround this, like disabling cookies in server action.

ralf-boltshauser commented 13 hours ago

ahh I see thank you, I will give it a shot!