PPR RDC inspector
A dependency-free diagnostics CLI for inspecting Next.js Partial Prerendering
.meta files. It extracts the React postponed state, inflates the Render Resume
Data Cache (RDC), and base64-decodes serialized use cache Flight payloads and
cached fetch bodies so the result can be examined as plaintext.
Typical uses include understanding which values were captured during a build, inspecting the shape of cached entries, comparing build outputs, and feeding the decoded data into other local analysis tools.
Note: Decoded output can include arbitrary application data. Keep it local unless you have reviewed it, and handle saved output according to your organization's data-handling policies.
Requirements
- Node.js 18.17 or later
- A completed Next.js production build or its
.nextoutput
Obtain the build output
The inspector reads build artifacts from .next; it does not build the app. To
analyze a particular build or deployment, scan its .next output directly.
If there is no existing .next output, run a production build first:
pnpm next buildWhen recreating a particular build, use the same application revision, Next.js version, environment variables, and other build-time data sources. A recreated build may differ if any of those inputs have changed.
Run the inspector
The inspector is a standalone Node.js script and does not need to be built or have dependencies installed:
git clone https://github.com/vercel-labs/ppr-rdc-inspector.git
cd /path/to/built-next-app
node /path/to/ppr-rdc-inspector/bin/ppr-rdc-inspect.mjs \
> decoded-postponed-state.txt
rg 'account|locale|feature' decoded-postponed-state.txtWith no arguments, the CLI recursively scans .next. An alternate directory
or an individual .meta file can be passed explicitly:
node /path/to/ppr-rdc-inspector/bin/ppr-rdc-inspect.mjs path/to/.next
node /path/to/ppr-rdc-inspector/bin/ppr-rdc-inspect.mjs path/to/page.metaProcess the decoded output
Decoded data is written to stdout and progress is written to stderr. This makes the output suitable for local search, transformation, or other stdin-based tooling:
node /path/to/ppr-rdc-inspector/bin/ppr-rdc-inspect.mjs \
| rg 'account|locale|feature'
node /path/to/ppr-rdc-inspector/bin/ppr-rdc-inspect.mjs \
| your-analysis-commandPiping avoids creating an intermediate decoded file. If you do save the output, review it before sharing it because it can contain application data.
Test fixture
The included Cache Components app returns a diagnostic marker from a use cache
function without rendering that field.
cd fixtures/cache-components-app
pnpm install
pnpm build
pnpm inspect > decoded-postponed-state.txt
rg 'RDC_ONLY_MARKER' decoded-postponed-state.txtExpected output includes:
{"displayName":"Visible account name","diagnosticMarker":"RDC_ONLY_MARKER_7cbe1a64"}The marker is not present in .next/server/app/index.html.
Limitations
- Results describe only the
.nextoutput being scanned. A rebuild may produce different cached data when its application revision or build-time inputs differ. - The format is an internal Next.js implementation detail and may change across releases.
- Decoded Flight output is made searchable but is not reconstructed into the original JavaScript objects.
- The inspector prints data for diagnostics but does not determine whether a value was expected to be cached. Interpret results in the context of the application source and build inputs.