Open tilman opened 3 months ago
I'm having similar issues.
loading.tsx
is triggered on page load. (Expected)revalidatePath("/")
on /
, loading.tsx
is not triggered (expected?)revalidatePath("/other-page")
on /other-page
, loading.tsx
is triggered only on the first invocation, but not for subsequent invocations (not expected?) This works as expected for me up to v14.2.0-canary.23, in v14.2.0-canary.24 I start to see issues.
@kevinmitch14 I think this is a different issue. My Problem is regarding Suspense boundaries and not regarding loading.tsx. I suggest you open a new issue or start a discussion on this topic.
loading.tsx
is a Suspense boundary.
When did the issues start to occur for you? Have you tried something before v14.2.0-canary.24?
Jep, I have tested and it was present in v14.2.4 as well
I have noticed it couple of month ago but never understood what is happening because of the hard way to reproduce it. But with the github example I linked above you can go back to older nextjs versions and reproduce it.
A temporal workaround is to add a key to the suspense boundary which changes on every render. But this feels kinda strange and I'm unsure about the negative consequences it has:
<Suspense key={Math.random()} fallback={...}>
...
<Suspense/>
v15.0.0-canary.14 has fixed a similar issue I was having from 14.2.2.
Hey Luke, thanks for the hint. I have upgraded the example to 15.0.0-canary.23
. Now the bug is even worse. Even on the first try it is not working now. In 15.0.0-canary.3
it was at least working for the first call of a server action and then the bug occured on all upcomming calls.
Link to the code that reproduces this issue
https://github.com/trieb-work/nextjs-broken-suspense-bug-example
To Reproduce
pnpm dev
and open it in the browserIf starting the app in production mode (pnpm build + pnpm start) the same problem persists. Only difference will be that there is no loading page displayed first (due to static optimization). But this can also be disabled if page is opting out of static optimization.
Current vs. Expected behavior
Current:
Expected:
Provide environment information
Which area(s) are affected? (Select all that apply)
Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Vercel (Deployed)
Additional context
No response