Next.js Discord

Discord Forum

what is the proper way to enable SSG and ISR?

Unanswered
Siberian Husky posted this in #help-forum
Open in Discord
Siberian HuskyOP
hi
I have s problem with SSG that does not works with specific routes.

In this example I have the blog-post route, it must generates SSG at build time, this page have next-intl to localize and get api requests.

you can see the blog-posts/[slug]/page.tsx on the following link:
https://github.com/sfwnisme/frontend-real-estate/blob/feat/site-info/app/%5Blocale%5D/(client)/(pages)/blog-posts/%5Bslug%5D/page.tsx

the purpoes of this page:
- generated as SSG without any issue
- ⁠enables the ISR to refresh the data if changes happened on the page


the problem:
I have to use ‘export const dynamic = “force-static”’ and ‘export const invalidate = 60’
, so I can enable the SSG generating.


Conclusion:
I need to know the right way to do SSG. and ISR and I think I am doing a wrong thing with the requests functions or the next-intl

4 Replies