Open ChiefORZ opened 1 year ago
Thank you for the great reproduction @ChiefORZ!
I've created an additional reproduction without next-intl, to make sure that it's not a library bug: CodeSandbox.
If you open https://sjdjxn-3000.csb.app/en/abc, you'll see false
being rendered. This is a value from context that is configured in app/[locale]/layout.tsx
. Navigating via Link
works, as mentioned above.
+1, also can reproduce this
I can reproduce the same issue in a production build with other layouts, not just not found page.
I'm having the same issue, a reload fixes it, but is very odd.
I've updated my CodeSandbox to use the latest stable version of Next.js (14.2.3 currently) and I think the bug has been resolved (new CodeSandbox).
I was able to render through the layout. In the project I'm working on, the architecture is features. Then: app > (features) > [...not-found] > page.tsx In my folder (features) I placed my layout file and it worked.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App Router
Link to the code that reproduces this issue or a replay of the bug
https://codesandbox.io/p/sandbox/elegant-joji-mxx7fn
To Reproduce
<Link />
- worksDescribe the Bug
To use next-intl you are supposed to use the
<Link />
provided bynext-intl/link
. This needs a context provided by next-intl. This is done in the root layout.tsx (app/[locale]/layout.tsx). This worked fine with version 13.4.9I tracked it down that the layout.tsx does not render on re-occurring renders - if you load the page and look at the console you can see:
On the first render the layout.tsx gets loaded perfects, on the second render the layout is skipped and therefore the context is not provided. It could be introduced by this PR https://github.com/vercel/next.js/pull/52589
Expected Behavior
The layout.tsx should be run on every render.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1471