-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
layout.tsx - Returns server errors if not located in root "app" folder (Crucial) #52722
Comments
The reproduction is 404 for me, can you update the access for that repo? |
Also having this error on Next 13.4.10... The layout file is inside a route group |
I confirm this does not happen on 13.4.9 |
Thank you code friend for confirming. |
Hello! In this branch, in line 6, I have replicated the error, and in another branch, same line, I have resolved it using Webpack. Well, technically the error isn't completely resolved, but I was able to make progress on it. 😅 |
Not using Turbopack at all just regular dev mode. Lets hope this can be reverted or fixed. |
This error happens to me as well, but in my case occurs when i call |
Bingo. Thats exactly the issue if no route found NotFound() returns these errors |
Same issue here. The error occurs before loading the |
I could fix my issue by creating layout.tsx inside app folder. I didn't have a root layout because i'm using next-int that requires you to have [locale] as root layout |
I can also confirm that I've been experiencing this issue after upgrading to |
Same.
I've been expecting this release because the not found improvements, but works worse than previous versions. And:
I also use the |
Update as of 07/20/2023: After removing |
not really since I don’t use turbo at all. |
Ah! That's right! Did you try downgrading to |
For me, yes. Was okay with .9, failed when upgraded to .10 and worked again when downgraded to .9 |
Same error when updating to |
For me it also started with 13.4.10 and I still have the error with 13.4.11. I'm not using turbo. Only happens for 404 routes. I'm using i18n and my "root" layout is inside |
Found that don't fails when triggering the 404 through a client navigation, in this case works well, but if I refresh the page the error appears again. Also, the official example for i18n doesn't work, but I'm not sure if is caused by the same error. |
So, this layout issue is not important @nextjs? |
I've deployed the example on my own vercel account, and it works (here the repo), but it's a bit different from my own integration, since for the i18n system I'm hiding the default locale from the path, like:
And in the they always redirect to the locale path, like:
Also, they don't have a custom 404 page. |
Latest update fixed this error but layout.tsx and not-found.tsx is not working if inside path like (website), (admin) etc. |
v 13.4.2 - work fine
|
Same error on the just released |
The problem for me is that the |
Yes, but if you have a alias (website) and (admin) which requires different layout.tsx it will still not work the way it should be. Not to mention that the custom not-found.tsx is not working. |
👍 |
Yes @sharifhh , I'm stuck on |
👍 |
I'm facing the same issue |
Not only localized apps, aliases in general (website), (admin) etc. Issue since 13.4.10 |
in v13.4.16 same issue |
Can someone provide a minimal reproduction as the original reproduction is 404 for me? And few folks are mentioning it's related to i18n but some are saying related to |
We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate. Why was this issue marked with the
|
you can find same issue here if you install the latest version of nextjs |
I still doing some test, but looks like for me, the issue was solved in v13.4.15. The earlier version that works for me it's v13.4.14-canary.4, although I think that my issue was solved in v13.4.14-canary.3 (but I can't install canary.3 by a dependency issue). |
@Abdelhadi92 I tried with the example from next-intl with latest nextjs (13.4.16) it picks up the locale layout |
Thanks @huozhi Yes, it works after upgrading next to 13.4.16. |
Close as there's no new updates for this issue and few folks confirmed it's fixed for them. If you still having trouble with the above error, please file a new issue with a reproduction, thanks! |
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: x64 Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 Binaries: Node: 18.16.1 npm: 9.5.1 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 13.4.10 eslint-config-next: 13.4.10 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.6 Next.js Config: output: N/A
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://galanthus-shiny-xylophone-97xj9r4vp639p49.github.dev/
To Reproduce
Move layout.tsx/jsx inside (website) to re-produce the error. Demo is provided with an URL.
check: https://galanthus-shiny-xylophone-97xj9r4vp639p49-3000.preview.app.github.dev/dasd (for error)
Move the layout outside to the "app" folder error is gone. Imported global styles not loading after moving the layout file to the "app" folder.
Go to random page /abc to see the server errors:
Describe the Bug
layout file has to be located in the root of "app" moving it inside a another path like (website), (front-end) will not work.
Expected Behavior
To work inside root, as in different route paths like it used to work in the previous version.
Which browser are you using? (if relevant)
Brave
How are you deploying your application? (if relevant)
Vercel
The text was updated successfully, but these errors were encountered: