-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEXT-1144] Parallel Routes do not apply individual loading.tsx
as described in documentation
#49243
Comments
Same for me! |
Yes. In this case the documentation is not describing the current behavior and is misleading. The loading and error components are being applied as follows: Seems that the root loading and error components are applied separately to each parallel route. This is inconvenient as precisely the goal of parallel routing is being able to manage separate parts of the UI that are not related with each other at the same time. |
loading.tsx
as described in documentationloading.tsx
as described in documentation
Any updates @timneutkens? |
You can temporarily put it in a route group |
It seems that |
And @timneutkens the route group doesn't work for me on |
Can confirm... But isn't this supposed to work like this? It just hidrates the component with the new data? bandicam.2023-05-22.11-46-49-540.mp4 |
#50107 (comment) loading and error.tsx |
FWIW in my testing using a default state (i.e. |
Having the same issue with |
Hey @timneutkens, could we have an estimate of timeline on this feature, please? It shouldn't be in the docs if you can't currently do what the docs are demonstrating (without resorting to a work around). |
Also the layout file inside a parallel route is ignored. For example /@team/layout.tsx will not be rendered. With /@team/(__workaround)/layout.tsx it works currently, but it is not optimal to use such hacks. |
FYI the route group hack doesn't seem to work in combination with a default.tsx: edit: The route group hack isn't needed anymore 👍 |
I'm not sure its fixed since i haven't had time to check. But they fixed some issues lately #51413 |
I think it's finally getting fixed, my current code that using |
I can confirm that #51413 has fixed these issues. 🥳 |
It's fixed with 13.4.7 for me too |
Cannot confirm that it works for me on |
I'm having the same issue but with layout.tsx. I had to apply the solution on #49243 (comment) of creating a (group) inside each of the parallel routes so that the nested layouts could finally work:
|
In my case, only production build is affected. I can run correctly in dev mode. Next version: |
For me the layout and loading are strange only on production builds either. next version: Demo is here Production: Development:
|
Still encountering this error on v13.5^ Hoping for a fix soon :( |
Still encountering on v13.5.2 |
Still on v14.0.3. This would supposed to be a crucial feature, right? |
@Shameekh-Naveed @jonatassales |
Hi all -- the original reproduction in this thread seems to be behaving correctly (testing against the latest Next.js canary). For those commenting on the loading state not appearing in production builds: the examples that have been shared indicate that your pages can be statically generated (learn more about dynamic rendering here). In other words, at build time, Next.js is prefetching your routes and generating static HTML. Once served to the user, since the page could be completely statically generated, there's no need to rendering a loading boundary as there's nothing to wait for. If anyone is still running into problems here, please open a new issue with a minimal reproduction and we'll take a look. As the original reproduction shared in this issue is now working, I'm going to close this. |
@ztanner What about a situation where a site has static dynamic routes and not all of the dynamic routes are prerendered on build time. Let's say we have a dynamic route In my opinion the loading states should be also rendered in that situation but now the UI is just stuck waiting for the whole page generation to be finished and sent to the client after which the site navigates to the page. It is quite horrible UX for the first user that tries to navigate to a page which is static but was not generated on build time. |
I have the same issue with 13.5.6. As a work around, I was able to remove the parallel route and replace it with a Suspense wrapper in layout.tsx <Suspense fallback={<LoadingHeader />}>
<Header params={params} />
</Suspense> |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 Binaries: Node: 16.19.1 npm: 8.19.3 Yarn: 1.22.19 pnpm: 7.3.0 Relevant packages: next: 13.3.5-canary.12 eslint-config-next: 13.4.0 react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
/~https://github.com/brunocangs/next-app-parallel-issue
To Reproduce
Run the project with
yarn dev
and navigate tohttp://localhost:3000
Describe the Bug
When using Parallel Routes (e.g.
/app/@slot/page.tsx
), the@slot
'sloading.tsx
states are never called or displayed.The current beahviours observed even differ in
dev
andprod
, as seen in the videos references.Prod Link: https://next-app-parallel-issue.vercel.app/
Dev behaviour:
@slot/page.tsx
) is async, so it displays a loading state. However this is the page's loading state, not the slot loading state.Untitled.mov
Prod behaviour:
I didn't include a prod video as it would only be a page reload
Expected Behavior
It is expected that, as mentioned in the documentation, the loading state for each of the slots will be correctly displayed per the image below
Which browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
Vercel
NEXT-1144
The text was updated successfully, but these errors were encountered: