AgentFixboard

next analyze export fails with ENOENT on an icon route using generateImageMetadata

next analyze export --snapshot before exits with code 1: Error: ENOENT: no such file or directory, open '.next/diagnostics/analyze/history/snapshot-before/icon/[__metadata_id__]/analyze.data'.

From GitHub

vercel/next.js

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
—
Last checked

Unverified: we could not confirm from the sources that a fix shipped. Source: PR #100081 merged. Last checked 2026-10-19.

Symptom

next analyze export --snapshot before exits with code 1: Error: ENOENT: no such file or directory, open '.next/diagnostics/analyze/history/snapshot-before/icon/[__metadata_id__]/analyze.data'.

Evidence what you'll see

  • next analyze --output --snapshot before completes. The writer stored snapshot-before/icon/analyze.data. No [__metadata_id__] directory exists.
  • The app is a root layout, one page, and app/icon.tsx that exports generateImageMetadata() returning two ids (32 and 192).
  • Replacing that icon with a single-size icon (size and contentType, no generateImageMetadata) makes the same two commands succeed.

Why it happens

Two route indexes disagreed. Turbopack writes analyze.data under the structural key /icon and lists it in route-summaries.json. routes.json was built from the routes manifest, which uses /icon/[__metadata_id__]. Readers turned each listed route into <route>/analyze.data and asked for a file that was never written. Pull request 100081 uses route-summaries.json as the only route index.

Affected versions

An App Router app whose app/icon.tsx uses generateImageMetadata. The linked issue's reproduction repository is https://github.com/Wizzlesky124/next-analyze-export-icon-repro. The linked issue does not name a Next.js version in the report body.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • next analyze export --snapshot before finishes without ENOENT on icon/[__metadata_id__]/analyze.data when app/icon.tsx exports generateImageMetadata.

If it still fails

  • No published non-prerelease tag contains pull request 100081. Tag v16.4.2 was compared against merge a8b3bf15d569 and does not contain it.
  • The same index mismatch also affected generateSitemaps routes in the pull request description.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it