nextjs - ✅(Solved) Fix Turbopack build fails if multiple app/ icons have same name [2 pull requests, 4 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#85496Fetched 2026-04-08 02:15:22
View on GitHub
Comments
4
Participants
4
Timeline
28
Reactions
11
Author
Assignees
Timeline (top)
subscribed ×10referenced ×5commented ×4labeled ×3

Error Message

  1. Error:

Build error occurred Error [TurbopackInternalError]: Dependency tracking is disabled so invalidation is not allowed at /Users/geist/dev/actions-runner/_work/next.js/next.js/turbopack/crates/turbo-tasks-backend/src/backend/mod.rs:1514:13

Fix Action

Fixed

PR fix notes

PR #89504: fix: support multiple icon formats with same base name (icon.png + icon.svg)

Description (problem / solution / changelog)

What?

Fixes a crash in Turbopack and incorrect behavior in Webpack when users have multiple icon files with the same base name but different extensions (e.g., icon.png and icon.svg) in their app directory.

Why?

This is a valid use case for browser fallback support - modern browsers can use SVG icons while older browsers (Safari <26) need to fall back to PNG. Previously:

  • Turbopack: Crashed during next build with "Dependency tracking is disabled so invalidation is not allowed"
  • Webpack: Silently ignored all but one format

How?

Turbopack: Changed virtual source filename from {stem}--route-entry.js to {filename}--route-entry.js (e.g., icon.png--route-entry.js and icon.svg--route-entry.js) to avoid file conflicts that triggered invalidation.

Webpack: Changed MetadataResolver to return all matching files instead of just the first one.

Both icon formats are now properly rendered:

<link rel="icon" type="image/png" sizes="114x114" href="/icon.png">
<link rel="icon" type="image/svg+xml" sizes="any" href="/icon.svg">

Fixes #85496 Fixes NEXT-4816

Changed files

  • crates/next-core/src/next_app/metadata/route.rs (modified, +5/-1)
  • packages/next/src/build/webpack/loaders/metadata/discover.ts (modified, +1/-3)
  • packages/next/src/build/webpack/loaders/next-app-loader/index.ts (modified, +25/-30)
  • test/e2e/app-dir/metadata-icons-parallel-routes/app/icon.png (added, +0/-0)
  • test/e2e/app-dir/metadata-icons-parallel-routes/metadata-icons-parallel-routes.test.ts (modified, +25/-0)

PR #89835: fix(turbopack): resolve build failure with multiple same-name app icons

Description (problem / solution / changelog)

What?

Include file extension in VirtualSource path for static metadata routes to prevent collisions when multiple icon files share the same stem (e.g., icon.png and icon.svg).

Why?

When an app directory contains multiple icon files with the same name but different extensions, Turbopack generates identical VirtualSource paths ({stem}--route-entry.js), causing a build failure.

How?

Changed the VirtualSource path format from {stem}--route-entry.js to {stem}.{ext}--route-entry.js in crates/next-core/src/next_app/metadata/route.rs, making each path unique.

Fixes #85496

  • Tests added
  • e2e test verifies build success, icon link tags in head, and both icon files served correctly

Changed files

  • crates/next-core/src/next_app/metadata/route.rs (modified, +3/-1)
  • test/e2e/app-dir/multiple-icons-same-name/app/icon.png (added, +0/-0)
  • test/e2e/app-dir/multiple-icons-same-name/app/icon.svg (added, +1/-0)
  • test/e2e/app-dir/multiple-icons-same-name/app/layout.tsx (added, +8/-0)
  • test/e2e/app-dir/multiple-icons-same-name/app/page.tsx (added, +3/-0)
  • test/e2e/app-dir/multiple-icons-same-name/multiple-icons-same-name.test.ts (added, +29/-0)
  • test/e2e/app-dir/multiple-icons-same-name/next.config.js (added, +6/-0)

Code Example

> Build error occurred
Error [TurbopackInternalError]: Dependency tracking is disabled so invalidation is not allowed at /Users/geist/dev/actions-runner/_work/next.js/next.js/turbopack/crates/turbo-tasks-backend/src/backend/mod.rs:1514:13

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:35:32 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6020
  Available memory (MB): 16384
  Available CPU cores: 12
Binaries:
  Node: 24.10.0
  npm: 11.6.0
  Yarn: N/A
  pnpm: 10.20.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: standalone
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/paschun/next-app-icon-repro

To Reproduce

  1. Place icons in app dir, like docs say. Two of them should have the same name. Like icon.png + icon.svg.
  2. next build
  3. Error:
> Build error occurred
Error [TurbopackInternalError]: Dependency tracking is disabled so invalidation is not allowed at /Users/geist/dev/actions-runner/_work/next.js/next.js/turbopack/crates/turbo-tasks-backend/src/backend/mod.rs:1514:13
  1. Remove either icon.png or icon.svg, or place in public/
  2. next build
  3. Build succeeds

Current vs. Expected behavior

I expcted the build to succeed even with icon.png and icon.svg in the app/ directory.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:35:32 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6020
  Available memory (MB): 16384
  Available CPU cores: 12
Binaries:
  Node: 24.10.0
  npm: 11.6.0
  Yarn: N/A
  pnpm: 10.20.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: standalone

Which area(s) are affected? (Select all that apply)

Output

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

Safari <26 needs icon.png, doesn't support icon.svg. https://caniuse.com/link-icon-svg

Relevant discussions: https://github.com/vercel/next.js/discussions/85232 https://github.com/vercel/next.js/discussions/84585

extent analysis

TL;DR

  • Renaming or removing one of the duplicate icon files (e.g., icon.png or icon.svg) in the app directory may resolve the build error.

Guidance

  • Verify that the issue is caused by the duplicate icon files by temporarily removing one of them and checking if the build succeeds.
  • Consider placing the icons in the public directory instead of the app directory to avoid potential conflicts.
  • Review the discussions linked in the issue for potential workarounds or fixes related to icon file handling in Next.js.
  • Check the Next.js documentation for the latest guidance on handling multiple icon files with the same name.

Example

No code snippet is provided as the issue is related to file naming and placement rather than code syntax.

Notes

  • The issue may be specific to the combination of Next.js version (16.0.1) and the operating system (Darwin).
  • The need for both icon.png and icon.svg is due to browser compatibility issues, as mentioned in the additional context.

Recommendation

  • Apply workaround: Rename or remove one of the duplicate icon files to resolve the build error, as this is a more immediate solution than waiting for a potential fix in a future version of Next.js.

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