-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
App directory root not-found.tsx
not compiled to 404.html
when using static export
#48227
Comments
Seeing this as well. |
still an issue as of 13.3.1 |
Since you can have a 404 page inside pages and a not-found file in app at the same time (and they can conflict), we are storing the not-found page in |
Same problem as of 13.4.2. Works as expected when running in dev mode, but the 404.html that gets exported is the default black one. Interestingly, it used to work in production mode when run locally with next start. But in a recent update, it stopping working locally as well. The problem I believe is as mentioned, a not-found.tsx in the app directory root should be exported as 404.html (which is the standard for at least Cloudflare Pages, and probably other hosts). Have tried the [...not-found] catch-all route trick to call a notFound() function, but (no big surprise) it doesn't work server side on a static site. |
Still ignoring custom not-found.tsx. 404.html is still being exported as the stock 404 page as of version 13.4.4. Any timeline for a fix please? |
Seem to have solved it for now by creating a 404 page (404 directory, with a page.tsx). Doing that exports it as 404.html, which overrides the default. This hack may not work for everyone, but it works for me since I'm hosting on Cloudflare Pages which routes 404s to 404.html. |
I received 400kb of error logs in the first 10 minutes
|
Hey! I'd be interested in resolving this issue. |
Still an issue as of 13.4.7 |
The fix in PR #52526 only seems to work to build the root It does not build any |
@Cretezy This issue was created for the "global app-directory 404 page (root not-found.tsx page)". Please create a new issue with the steps to reproduce the problem you're having. For example, are you using next.config.js with I think this could work with So its best to create a new issue with the steps to reproduce the problem, thanks! |
This closed issue has been automatically locked because it had no new activity for a month. 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
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Static HTML Export (output: "export")
Link to the code that reproduces this issue
https://github.com/ky28059/ky28059.github.io
To Reproduce
Run
next build
, then navigate to the 404 page.Describe the Bug
Wasn't sure if this qualified as a bug report or feature request, but when running
next build
with a global app-directory 404 page (rootnot-found.tsx
page), the generated404.html
in/out
is Next's default 404 page and not thenot-found
page.Expected Behavior
Because
/app/not-found.tsx
handles unmatched URLs like/pages/404.tsx
formerly did, it makes sense for its HTML contents to be compiled to the static export's404.html
instead of being ignored in the build output.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1392
The text was updated successfully, but these errors were encountered: