Use Next.js icon file convention so favicon respects multi-zone basePath#856
Open
SakshiKekre wants to merge 4 commits into
Open
Use Next.js icon file convention so favicon respects multi-zone basePath#856SakshiKekre wants to merge 4 commits into
SakshiKekre wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move
policyengine.pngtoapp/icon.pngso Next.js' icon file convention auto-prefixesbasePath, replacing the manual icon URL inmetadata.icons.Why the file convention for the icon
metadata.iconsURLs are not auto-prefixed withbasePath(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.NEXT_PUBLIC_BASE_PATHoverride added in this PR was reverted: the official Next.js multi-zones guide andwith-zonesexample only show a literalbasePath, and the override hides basePath bugs that would otherwise surface in dev.