Replies: 1 comment 2 replies
-
May be a Next.js problem, you can try to create a custom |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i have a confusing "bug"
starting from "yarn create fumadocs-app", i made some changes.
[Qiestion 1] now I can't get nextjs default 404 page work
when navigate to http://localhost:4000/docs/test2
where /docs/test2 (folder) does not exist
In my code, /app/docs/[...slug]/page will be triggered. Within it, the code if (!page) notfound()
gives the error as follows
"
In HTML,
This will cause a hydration error.
app-router.js:77 HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Only one element on document allowed.
"
[Question 2] docs routing
i notice in the original example,
when navigate to http://localhost:4000/docs/test2
where /docs/test2 (folder) does not exist
the handler /app/docs/[...slug]/page will NOT be triggered
from my console log, the sequence is
GET /docs/test2 404 in 12ms
----------> app/RootLayout
----------> app/(home)/layout
-----> app/(home)/page
It never calls /app/docs/[...slug]/page. That is strange.
But in my modified version, it calls /app/docs/[...slug]/page (that I assume it is correct handling) however
my console log sequence is
----------> app/RootLayout
-----> app/docs/[...slug]/page
----------> app/docs/layout
GET /zh-TW/docs/test2 404 in 40m
Then gives error described in Question 1
Thanks
Beta Was this translation helpful? Give feedback.
All reactions