App router: build is not recognising the PPR routes correctly #77933
-
QuestionI have PPR turned on and have set up the import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
experimental: {
ppr: true,
// dynamicIO: true,
},
};
export default nextConfig;
import { RandomPokemonList } from "@/components/RandomPokemonList";
import { WeatherInfo } from "@/components/WeatherInfo";
import { Suspense } from "react";
import { Loading } from "@/components/Loading";
export default function Page() {
return (
<div className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
<p>Static Content</p>
<p>Pokemon list with delay</p>
<Suspense fallback={<Loading />}>
<RandomPokemonList />
</Suspense>
<p>Weather info</p>
<Suspense fallback={<Loading />}>
<WeatherInfo />
</Suspense>
</div>
);
} But after running the build command > next build
▲ Next.js 15.3.0-canary.43
- Experiments (use with caution):
✓ ppr
Creating an optimized production build ...
✓ Compiled successfully in 0ms
✓ Linting and checking validity of types
✓ Collecting page data
✓ Generating static pages (6/6)
✓ Collecting build traces
✓ Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 144 B 112 kB
├ ○ /_not-found 144 B 112 kB
└ ○ /pokemon 144 B 112 kB
+ First Load JS shared by all 111 kB
├ chunks/470-5dbdf66bb252fac9.js 46.6 kB
├ chunks/750181ff-dd33d3cb6ddd5fd5.js 62.9 kB
└ other shared chunks (total) 1.89 kB
○ (Static) prerendered as static content
I also ensured that I am using the latest canary build of Next by checking both the {
"name": "next-ppr-dynamicio-pokemon",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "15.3.0-canary.43",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^4",
"typescript": "^5"
}
}
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
next:
specifier: 15.3.0-canary.43
version: 15.3.0-canary.43([email protected]([email protected]))([email protected])
react:
specifier: ^19.0.0
version: 19.1.0
react-dom:
specifier: ^19.0.0
version: 19.1.0([email protected]) What confuses me is that as soon as I enable dynamicIO, the build process correctly recognizes the page to be partially rendered. > next build
▲ Next.js 15.3.0-canary.43
- Experiments (use with caution):
✓ ppr
✓ dynamicIO
Creating an optimized production build ...
✓ Compiled successfully in 0ms
✓ Linting and checking validity of types
✓ Collecting page data
✓ Generating static pages (6/6)
✓ Collecting build traces
✓ Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 144 B 112 kB
├ ○ /_not-found 144 B 112 kB
└ ◐ /pokemon 144 B 112 kB
+ First Load JS shared by all 111 kB
├ chunks/470-5dbdf66bb252fac9.js 46.6 kB
├ chunks/750181ff-dd33d3cb6ddd5fd5.js 62.9 kB
└ other shared chunks (total) 1.89 kB Expected BehaviorThe build process should correctly identify routes for partial pre-rendering without setting ReproductionHere is the link to the repo to reproduce the issue: https://github.com/kryptonian41/next-ppr-dynamicio |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Did you add this to the page? export const experimental_ppr = true |
Beta Was this translation helpful? Give feedback.
-
@leerob and @manovotny can you help in identifying what's the issue here? |
Beta Was this translation helpful? Give feedback.
Hmm I see it might be just that. I was playing around more and found that a
fetch
call with{ cache: 'no-store' }
is also a valid dynamic API call. So after making that change and removing theawait connection()
function call, I am able to get the/pokemon
route to be built as partially pre-rendered.Although
{ cache: 'no-store' }
is the default forfetch
from Next 15 and above, for PPR to work with a component only has fetch as a dynamic API call it needs to be specified explicitly.