Next.js Discord

Discord Forum

Need help with fetching in SSR

Unanswered
Staffordshire Bull Terrier posted this in #help-forum
Open in Discord
Staffordshire Bull TerrierOP
Im trying to fetch data in my SSR component (Home view) . I have my fetch in try catch soo when Error is thrown, next.js redirect me to error.tsx. When i "npm run dev" everything is okey but when i try to build it, if my server ( where i fetch from ) is not running, im getting build error cause during the build, build is trying to fetch that data and then error is thrown and thats stopping build. Am i doing something wrong ? Maybe i just dont understand SSR
#SSR

1 Reply

Staffordshire Bull TerrierOP