Open bananashell opened 1 day ago
It might be that a clarification in the documentation is all that is needed.
Either that default.tsx
doesn't cause a Suspense boundary with loading.tsx
or that async default.tsx
are discouraged and that you should only do @header/[...path]/page.tsx
+ @header/[...path]/loading.tsx
when you by default want to render the same content on all sub routes.
Kinda like the mental model
if(validationOk){
return OK()
}
return Error()
vs
if(!validationOk){
return Error()
}
return OK()
Link to the code that reproduces this issue
https://github.com/bananashell/nextjs-parallel-route-loading-issue
To Reproduce
Current vs. Expected behavior
If a loading.tsx is added to the root of a parallel route it only uses that suspense boundary on the root level.
Give this tree
/
will use the loading.tsx if@header/page.tsx
is async/a
directly would not use the loading.tsx for@header
and prevent streaming from happeningThe only solution I've found for this is to manually add a Suspense boundary to
default.tsx
Provide environment information
Which area(s) are affected? (Select all that apply)
Parallel & Intercepting Routes
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
No response