-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
Can't reach to 404 pages automatically. #202
Comments
I've never had this problem before. Do you have any middleware, or do you use any |
@theodorusclarence Code (Middleware)_app.tsx
/* eslint-disable @typescript-eslint/no-explicit-any */
import AOS from 'aos';
import { SessionProvider } from 'next-auth/react';
import React, { useEffect } from 'react';
import { QueryClient, QueryClientProvider } from 'react-query';
import '@/styles/aos.scss';
import '@/styles/globals.css';
import '@/styles/colors.css';
// !STARTERCONF This is for demo purposes, remove @/styles/colors.css import immediately
/**
* !STARTERCONF info
* ? `Layout` component is called in every page using `np` snippets. If you have consistent layout across all page, you can add it here too
*/
const MyApp = ({
Component,
pageProps: { session, ...pageProps },
}: {
Component: any;
pageProps: any;
}) => {
const [queryClient] = React.useState(() => new QueryClient());
// AOS animation
useEffect(() => {
AOS.init({
once: true,
duration: 500,
easing: 'ease-out-cubic',
});
});
return (
// next-auth
<SessionProvider session={session}>
{/* infiniteScroll */}
<QueryClientProvider client={queryClient}>
{/* PageProps */}
<Component {...pageProps} />
{/* Debug Mode */}
{/* import { ReactQueryDevtools } from 'react-query/devtools';
<ReactQueryDevtools initialIsOpen={false} /> */}
</QueryClientProvider>
</SessionProvider>
);
};
export default MyApp; Productionsite 1 : https://www.cue8949.com (deploy on AWS with docker) site 2 : https://nangmanski-web-v2.vercel.app (deploy on Vercel) Problemboth site has same |
Can I see the code of the getServerSideProps? I suspect it is because you catch all the routes for index with the getServerSideProps. But I might be wrong; if you didn't, I think its best to open up an issue in the Next.js repository. |
Thanks for help! 🙏 |
Issue
When user put wrong URL, pages doesnt go 404 pages (neither basic 404 pages of Nex.js) automatically.
Tried
Local : delete
.next
folder > yarn build > yarn startServer : Deploy on AWS / Deploy on vercel
Code
404.tsx
The text was updated successfully, but these errors were encountered: