next.js
fe39a3c4 - fix: support multiple icon formats with same base name (icon.png + icon.svg) (#89504)

Commit
51 days ago
fix: support multiple icon formats with same base name (icon.png + icon.svg) (#89504) ## 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: ```html <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
Author
Parents
Loading