generateMetadata ignores loading.tsx from showing (next 14.2.3)
Unanswered
Brown bear posted this in #help-forum
Brown bearOP
When wanting to upgrade to Next.js version 14.2.3 I noticed a weird behaviour with our
After a little digging today I noticed that when using
I have created a little demo here https://nextjs-14-2-3-loading-issue.vercel.app/ - the about page uses an extra wait of 3000ms to complete compared to the page itself; the news page uses the same delay but on the page itself.
Code can be found here: https://github.com/QuadDepo/nextjs-14.2.3-loading-issue
Does anyone have encountered this before and can this be labeled as a bug? Or is this expected behaviour?
loading.tsx when navigating to pages it would start off correctly by showing the skeleton but after x seconds the loading would disappear and cause a layout shift. This resulted in the footer component moving up all the way to the header (almost as there wasn't any content on the page). After a little digging today I noticed that when using
generateMetadata that takes longer than the page it self it would clear the loading state but won't display anything.I have created a little demo here https://nextjs-14-2-3-loading-issue.vercel.app/ - the about page uses an extra wait of 3000ms to complete compared to the page itself; the news page uses the same delay but on the page itself.
Code can be found here: https://github.com/QuadDepo/nextjs-14.2.3-loading-issue
Does anyone have encountered this before and can this be labeled as a bug? Or is this expected behaviour?
1 Reply
Brown bearOP
I have updated the example introducing an other use case which might be causing the issue; I have created an extra link to a page and disabled prefetching for it, this seems to be resolving the issue but still doesn't explain to me why this would be happening...