-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
pages/404 can not have getInitialProps/getServerSideProps #10919
Comments
I have a similar problem. if pages/[id].js is following export default ()=> <h1>something...</h1> For example, we can access the following URL:
but, /404 can not be generated on |
Same problem here: Example: 404.js import Head from "next/head";
import HeaderTop from "../components/Header/HeaderTop";
import HeaderMainWithBackground from "../components/Header/HeaderMainWithBackground";
import S404 from "../components/Sections/S404";
import Footer from "../components/Sections/Footer";
export default (props) => {
return (
<>
<Head>
<title>{props.t('Error.title')}</title>
<meta name="description" content={props.t('Error.description')} />
</Head>
<HeaderTop/>
<HeaderMainWithBackground background="asdasd.jpg" pageName={props.t('Error.name')} {...props}/>
<S404 {...props}/>
<Footer {...props}/>
</>
)
}; |
Hi, it looks like the Note: having |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
A custom pages/404.tsx:
causes an internal server error on the dev server. The log error complains about
getInitialProps
;note: we have a custom _app.tsx file that uses
getInitialProps
.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
No error or suggests using _error.js. Note: using a _error.js works for us.
Screenshots
System information
The text was updated successfully, but these errors were encountered: