nextjs - 💡(How to fix) Fix app/favicon.ico scaffold conflicts with unstable_instant validation; build error doesn't name the file [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#91787Fetched 2026-04-08 01:12:00
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

Error Message

No filename, no suggested fix. The cause is app/favicon.ico scaffolded by create-next-app — removing it or moving it to metadata.icons in the layout resolves the error. The filename is not surfaced anywhere in the output. Expected: either the build succeeds (the scaffold and the feature ship in the same version and should be compatible out of the box), or the error names the conflicting file.

Root Cause

Previously filed as https://github.com/vercel/next.js/issues/91786 — closed because the repro link was not placed in the correct template section.

Code Example

Relevant Packages:
  next: 16.2.1
  react: 19.2.4
  react-dom: 19.2.4
  typescript: ^5
  eslint-config-next: 16.2.1
Next.js Config:
  cacheComponents: true
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/aurorascharff/instant-favicon-repro

To Reproduce

  1. Scaffold a new app: npx create-next-app@latest (Next.js 16.2.1)
  2. Add to next.config.ts: cacheComponents: true
  3. Add to app/page.tsx: export const unstable_instant = { prefetch: 'static' }
  4. Run next build — build fails

Current vs. Expected behavior

Build fails with:

"Runtime data such as cookies(), headers(), params, or searchParams was accessed inside generateMetadata or you have file-based metadata such as icons that depend on dynamic params segments."

No filename, no suggested fix. The cause is app/favicon.ico scaffolded by create-next-app — removing it or moving it to metadata.icons in the layout resolves the error. The filename is not surfaced anywhere in the output.

Expected: either the build succeeds (the scaffold and the feature ship in the same version and should be compatible out of the box), or the error names the conflicting file.

Provide environment information

Relevant Packages:
  next: 16.2.1
  react: 19.2.4
  react-dom: 19.2.4
  typescript: ^5
  eslint-config-next: 16.2.1
Next.js Config:
  cacheComponents: true

Which area(s) are affected?

create-next-app, cacheComponents, Metadata

Which stage(s) are affected?

next build (local)

Additional context

Previously filed as https://github.com/vercel/next.js/issues/91786 — closed because the repro link was not placed in the correct template section.

extent analysis

Fix Plan

To resolve the build failure, you need to move the favicon.ico file to the metadata.icons section in your layout or remove it. Here are the steps:

  • Move the favicon.ico file to the public directory and reference it in your next.config.ts file:
// next.config.ts
module.exports = {
  //... other configurations
  experimental: {
    metadata: {
      icons: [
        {
          src: '/favicon.ico',
          type: 'image/x-icon',
        },
      ],
    },
  },
}

Alternatively, you can remove the favicon.ico file if it's not needed.

Verification

After making the changes, run next build again to verify that the build succeeds.

Extra Tips

  • Make sure to update your next.config.ts file to reference the new location of the favicon.ico file.
  • If you're using a custom layout, ensure that you've updated the metadata.icons section accordingly.
  • For more information on Next.js metadata, refer to the official documentation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING