Next.js Discord

Discord Forum

Static Generation in Next.js 15: Mixed Static/Dynamic Pages Setup

Unanswered
Manx posted this in #help-forum
Open in Discord
ManxOP
What I'm trying to accomplish:

I need to create a Next.js 15 project where some routes generate completely static HTML files (like old-school static sites with clean HTML in view source), while other routes remain dynamic with server components. I've heard conflicting information about whether Next.js 15 removed the ability to generate truly static pages.

Current issue:
When I view source on my static routes, I'm getting this hydration-heavy HTML with lots of Next.js runtime scripts instead of clean static HTML:

<!DOCTYPE html><!--KPiiKLAcMtwQNUuwnI5--><html lang="en">
<!-- Lots of _next/static/chunks scripts and hydration code -->
<script>self.__next_f.push([1,"0:{"P":null...

What I've tried:
- Adding export const dynamic = 'force-static' to specific pages
- Using generateStaticParams for parameterized routes
- Researching output: 'export' but unclear if this makes the entire app static
- Looking into next export but seems deprecated

Specific questions:
1. Did Next.js 15 remove the ability to generate completely static HTML pages?
2. How can I configure a mixed setup where some routes are fully static (clean HTML) and others remain dynamic?
3. Is output: 'export' an all-or-nothing setting, or can it be applied selectively?

Any guidance on achieving this mixed static/dynamic architecture would be greatly appreciated!

0 Replies