angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Default generated favicon.ico doesn't work -> rename to png works

Open hci2 opened this issue 1 year ago • 1 comments

Command

new

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When scaffolding a new Angular project via ng new <PROJECT_NAME> the generated favicon.ico does not work. I just renamed it to favicon.png and changed the reference in index.html and it works immediately.

How about changing the scaffolding to use PNG instead of *.ico?

Minimal Reproduction

favicon.ico (default after generating via ng create):

Image

favicon.png (after renaming and changing):

Image

Exception or Error

No response

Your Environment

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | | / ___ | | | | (| | || | | (| | | | || | | | // __| ||_, |_,||_,|| _||| |___/

Angular CLI: 18.2.8 Node: 20.17.0 Package Manager: npm 10.9.0 OS: darwin arm64

Angular: 18.2.8 ... animations, cli, common, compiler, compiler-cli, core, forms ... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1802.8 @angular-devkit/build-angular 18.2.8 @angular-devkit/core 18.2.8 @angular-devkit/schematics 18.2.8 @schematics/angular 18.2.8 rxjs 7.8.1 typescript 5.5.4 zone.js 0.14.10

Anything else relevant?

IDE: VS Code (1.94.2 (Universal)) Browser: Chrome (129.0.6668.91 (Official Build) (arm64)) OS: MacOS (15.0.1)

hci2 avatar Oct 16 '24 09:10 hci2

Moreover, I also noticed that the docs are not up-to-date regarding src/assets and src/favicon.ico, see: https://angular.dev/reference/configs/workspace-config#assets-configuration.

hci2 avatar Oct 16 '24 09:10 hci2

Hi @hci2, I couldn't reproduce the issue you've mentioned.

Image

Regarding the documentation issue, please open an issue at https://github.com/angular/angular.

alan-agius4 avatar Oct 16 '24 11:10 alan-agius4

Hmmm, that is weird. I double-checked and it worked in Safari and Firefox as well.

I tried different variants and came to this entry in Stackoverflow (https://stackoverflow.com/a/28436056/11494882) to force the browser to refresh via setting <link rel="icon" type="image/x-icon" href="favicon.ico?v=2"> in index.html and then this finally worked.

After setting version: Image

We can close this ticket because it has to do with the caching of Chrome and is not related to the code. Thank you anyway for your help.

hci2 avatar Oct 17 '24 12:10 hci2

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.