Comments (4)
I've never had this problem before.
Do you have any middleware, or do you use any getStaticProps
/getServerSideProps
?
from ts-nextjs-tailwind-starter.
@theodorusclarence
Thanks for reply and amazing starter package 🙇♂️
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;
Production
site 1 : https://www.cue8949.com (deploy on AWS with docker)
didn't use any getStaticProps/getServerSideProps
using useInfiniteQuery from 'react-query'
or Axios
to fetch data from api.
site 2 : https://nangmanski-web-v2.vercel.app (deploy on Vercel)
using getServerSideProps
to fetch data. it shows _error.tsx
when it cant fetch data.
Problem
both site has same _404.tsx
and _error.tsx
and both site has same issue that can't reach to _404.tsx
when user go to invalid url.
from ts-nextjs-tailwind-starter.
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.
from ts-nextjs-tailwind-starter.
Thanks for help! 🙏
from ts-nextjs-tailwind-starter.
Related Issues (20)
- Next 13 HOT 1
- SVGR Webpack to SWC
- Next.js 13 App Directory HOT 13
- tailwind css eslint HOT 1
- setting theme to white by default HOT 2
- yarn lock file HOT 1
- issue changing site title HOT 3
- When I use "yarn install" I get 'husky' is not recognized as an internal or external command HOT 1
- jj
- Local fonts are not loading when deoploying HOT 3
- Type error: 'Component' cannot be used as a JSX component. HOT 3
- What happened to the SEO component? HOT 1
- font-display should not be `optional` by default HOT 1
- why to put react and nextjs crap when only html is needed?
- SVG type HOT 1
- how to import scss each page ? HOT 2
- Depfu Error: No dependency files found
- Dependency Dashboard
- AppPage › renders the Components invariant expected app router to be mounted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-nextjs-tailwind-starter.