-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Non-root layouts not loaded in v0.21.8 #1055
Comments
I think this patch is missing something. I'm still getting errors. Working on debugging... |
|
Ah, yea, I don't think we have any e2e tests to check nested layouts. Sorry about this, I can help look into a fix today |
fix for #1055 Co-authored-by: Tyler <[email protected]>
Sorry... @tylersayshi I think we missed something here. I had to apply this patch to v0.21.9.
|
I wonder if we can write a test for it. |
Yeah, I assumed https://github.com/dai-shi/waku/blob/main/e2e/21_create-pages_standalone.spec.ts#L36-L39 would catch... For my error, my layout was two levels deep - so maybe we can reproduce by adding /nested/baz/layout.tsx with a /nested/baz/[id]/view.tsx page route. |
- acc.push(acc[index - 1] + '/' + segment.name);
+ acc.push(acc[index] + '/' + segment.name); This part of the diff I intentionally omitted, I'll add a test to replicate the further nested path and make sure layouts are applied there as well. 👀 Correction: You were right and this is my own off by one error 🤦. I'll send up a PR |
Adds tests for layouts with nesting and slugs fixes dai-shi#1055
Adds tests for layouts with nesting and slugs fixes #1055 --------- Co-authored-by: Tyler <[email protected]>
I think there's a bug in v0.21.8. The list of found path segments with _layout.tsx files is incorrect. It includes
undefined
and[object]
strings. I think the fix is to usesegment.name
instead ofsegment
[edit: and useindex
instead ofindex - 1
].There should probably be a test case to catch this...
The text was updated successfully, but these errors were encountered: