How to fix build error (Static) prerendered as static content
Unanswered
Wedge-tailed Shearwater posted this in #help-forum
Wedge-tailed ShearwaterOP
Hello how can I fix a build problem (Static) prerendered as static content
12 Replies
Mini Satin
This is not an error
Next JS is telling you that the html files are rendered staticly, that means pre-generated at build time : you're /login and /dashboard pages are both generated inside the ".next" folder.
If you want to render dynamicly you can use route segment config at a page level https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
You can opt in differents type of rendering depending of what you want but Next has also automatics behaviors that you should be aware of, like caching for your request and so on.
@Mini Satin You can opt in differents type of rendering depending of what you want but Next has also automatics behaviors that you should be aware of, like caching for your request and so on.
Wedge-tailed ShearwaterOP
Ok I got you, so it can be in production?
sorry I am new to this version
I added this to the page level which is layout.tsx
Mini Satin
Yes so now instead of a circle, aside your page you should have a lambda sign that mean that the page is now rendered dynamicly (on demand, when someone visits the page)
There's others options to activate or not this behavior
like using cookies, dynamic segment routes and other ones
@Wedge-tailed Shearwater Ok I got you, so it can be in production?
Mini Satin
You got 3 main rendering techniques :
In production a static rendered page will never be rebuild, this is SSG. (static site generation)
If you opt in a revalidation feature, like
And if you opt in a dynamic rendering feature, like you got here, then it's SSR (server side generation)
In production a static rendered page will never be rebuild, this is SSG. (static site generation)
If you opt in a revalidation feature, like
export const revalidate = 60 , then it's ISG (incremental static generation, got some trouble with this one :p)And if you opt in a dynamic rendering feature, like you got here, then it's SSR (server side generation)