FaviconIcon

Updated

Installing One Favicon Package in Next.js and Vite

On this page

A reproducible installation case using the same original favicon files in two minimal production projects.

Acorn Notes is an original demonstration project. Local production tests were recorded on November 16, 2026. The case pages and downloads are published; the path-repair case also includes real public checker reports. The framework projects were tested locally.

Environment and downloads

Next.js 16.2.6, Vite 8.3.8 and React 19.2.6; Node 24.18.0 and pnpm 10.13.1. Each project includes its own lockfile, README, source files, original icons and declaration diff. These are local production builds, not evidence of a hosted customer deployment.

Next.js project ZIP · Vite project ZIP

Next.js: public files and metadata

Copy the selected files to public/. Declare icons and the manifest in the root layout metadata. Do not retain an app/favicon.ico or app/icon file that overrides this setup. The fixture uses plain JavaScript and no extra UI dependencies.

Run the Next.js fixture
pnpm install --frozen-lockfile
pnpm build
pnpm start

Visit localhost:3111 and /settings/profile/. Both pages declare the same five icon/manifest links. The recorded HTTP run compared every installed file against the original bytes, then checked both manifest image URLs.

Exact declaration diff · Full Next.js installation guide

Next.js production profile page
Next.js production profile page — actual local browser capture, November 16, 2026.

Vite: root and subfolder deployment

Keep the images in public/. Use %BASE_URL% in index.html so the build resolves every link under the configured base. The manifest icon paths remain relative to the manifest location.

Run root and dashboard builds
pnpm install --frozen-lockfile
pnpm build
pnpm preview
# After stopping preview, test the subfolder build:
DEMO_BASE=/dashboard/ pnpm build
DEMO_BASE=/dashboard/ pnpm preview

Visit localhost:3112/ for the root build, or localhost:3112/dashboard/ after the subfolder build. Also open settings/profile/ under the same base. The verification checks the final HTML and image bytes, not just the existence of files in dist/.

Exact declaration diff · Full React/Vite guide

Vite production profile page under dashboard
Vite production profile page under dashboard — actual local browser capture, November 16, 2026.

Verification and limits

Next.js HTTP record · Vite root HTTP record · Vite dashboard HTTP record

The records include local URLs, response types, hashes and decoded dimensions. No browser cache fault or Google Search update was tested. This case reuses the contain/zero-padding conversion. For a broken URL, see the controlled 404 repair case.