How to make suspense work properly?

Hello guys, i have an next js app, and there is a catalog page, in ssr component i'm making fetch request for data and wraps this component in suspense with skeleton fallback, but on navigation it awaits request to be resolved and only then redirects me to the catalog page. What's the problem and how to redirect user immediately and show fallback while data is fetching? here is an example https://stackblitz.com/edit/next-playground-oe67nrlp?file=app%2Fpage.tsx,app%2Fcatalog%2Fpage.tsx
StackBlitz
Next.js Playground (duplicated) - StackBlitz
The React framework for production
5 Replies
>  /dev/trivee/
> /dev/trivee/2mo ago
Move data fetching to a useEffect hook in a client component to allow immediate rendering with a fallback while data loads
RobyDobyDingo
RobyDobyDingoOP2mo ago
But then where will be no seo for catalog, the primary page of the app
Jakov
Jakov2mo ago
Have you tried adding loading.tsx?
RobyDobyDingo
RobyDobyDingoOP2mo ago
yes, it works the same way. I don't understand why suspense not showing fallback while fetching data, why it's waiting for resolving and only after that redirects me there? Its weird, but i heard that if deactivate antivirus it will work, i tried it and it really works! so dumb but it work only locally, on production it still not working:(
Jakov
Jakov2mo ago
Wait for it to deploy I guess

Did you find this page helpful?