Skip to content

Commit

Permalink
examples: add favicon.ico for to avoid browser requests (#62511)
Browse files Browse the repository at this point in the history
## What?

To avoid the default `favicon.ico` request by the browser, we are adding
a vercel `favicon.ico` to the project.
Currently, we handle exceptions for `favicon.ico` entering the Dynamic
Route `[lang]` in the following manner, but in this case, favicon.ico
renders the entire page.


[example:app-dir-i18n-routing](https://github.com/vercel/next.js/blob/canary/examples/app-dir-i18n-routing/get-dictionary.ts#L12)
```ts
export const getDictionary = async (locale: Locale) =>
  dictionaries[locale]?.() ?? dictionaries.en();
```


Instead of `favicon.ico`, the full HTML of the default language 'en' is
rendered.
![스크린샷 2024-02-26 오전 1 17
56](https://github.com/vercel/next.js/assets/59330828/ea46b75b-ae93-4db4-9b4b-db33fb5d5709)

In the correct case
![스크린샷 2024-02-26 오전 1 24
49](https://github.com/vercel/next.js/assets/59330828/7faabec1-1fc7-4330-a5c3-30449efcace6)

Fixes #46918

Co-authored-by: Sam Ko <sam@vercel.com>
  • Loading branch information
dongwonnn and samcx authored Feb 26, 2024
1 parent 0d1b11f commit e35ace6
Showing 1 changed file with 0 additions and 0 deletions.
Binary file added examples/app-dir-i18n-routing/public/favicon.ico
Binary file not shown.

0 comments on commit e35ace6

Please sign in to comment.