Skip to content

Use Next.js icon file convention so favicon respects multi-zone basePath#856

Open
SakshiKekre wants to merge 4 commits into
mainfrom
fix/multizone-icon-basepath
Open

Use Next.js icon file convention so favicon respects multi-zone basePath#856
SakshiKekre wants to merge 4 commits into
mainfrom
fix/multizone-icon-basepath

Conversation

@SakshiKekre
Copy link
Copy Markdown

@SakshiKekre SakshiKekre commented Apr 24, 2026

Summary

Move policyengine.png to app/icon.png so Next.js' icon file convention auto-prefixes basePath, replacing the manual icon URL in metadata.icons.

Why the file convention for the icon

metadata.icons URLs are not auto-prefixed with basePath (see Next.js #61487, closed as not planned). Next.js' app/icon.{png,svg,...} file convention does prefix correctly and emits a content-hashed link tag with the right MIME type — so we use the framework convention instead of working around the known issue.

Verification

  • bun run build<link rel="icon" href="/us/taxsim/icon.png?..." sizes="512x511" type="image/png">

Out of scope

  • apple-touch-icon: source is 512×511 PNG, not the recommended 180×180. Tracked separately.
  • The earlier env-driven NEXT_PUBLIC_BASE_PATH override added in this PR was reverted: the official Next.js multi-zones guide and with-zones example only show a literal basePath, and the override hides basePath bugs that would otherwise surface in dev.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-taxsim Ready Ready Preview, Comment May 7, 2026 4:26pm

Request Review

Move policyengine.png to app/icon.png and remove the metadata.icons block.
Next.js auto-emits a basePath-prefixed <link rel="icon"> with content hash
and MIME type, replacing the manual BASE_PATH string concatenation that
worked around Next.js #61487 (metadata.icons URLs not auto-prefixed).
The official Next.js multi-zones guide and with-zones example only show a
literal basePath. The env-driven NEXT_PUBLIC_BASE_PATH override added earlier
in this PR was a dev-ergonomics workaround that hides basePath bugs in dev
and isn't supported by the docs. Drop it; the icon file convention change
remains the only canonical fix in this PR.
@SakshiKekre SakshiKekre changed the title Respect multizone base path for icons and assets Use Next.js icon file convention so favicon respects multi-zone basePath May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant