Next.js Discord

Discord Forum

generateStaticParams or dynamic='force-static'; required* to enable ISG for dynamic segments?

Unanswered
Sander posted this in #help-forum
Open in Discord
So the thing is that NextJS is static by default but making a dynamic route such as /[paramA]/[paramB].
And we route to http://localhost:3000/a/b

By default the page is always dynamically rendered. Even if you add export const revalidate = 900;.
The only way to make it static currently is to add:
export const generateStaticParams = async () => {
  return [];
};

OR
export const dynamic = 'force-static';


Also while forcing static by doing this while waiting for the page to load no loading.tsx is shown.
The page stays on the current page until the request is finished, giving 0 feedback to the user that we are waiting for the page.

Is this by design? Am I missing something regarding static dynamic routes?
Is the no loading page a bug?

Also can server actions be cached while using the page.tsx searchParams data?

2 Replies

No loading state while waiting for static pages.
loading.tsx is present in /app, /[a]/[b] and /search/
bumb