Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails when favicon is missing #291

Closed
calebmer opened this issue Jul 29, 2016 · 7 comments
Closed

Build fails when favicon is missing #291

calebmer opened this issue Jul 29, 2016 · 7 comments

Comments

@calebmer
Copy link

I tried deleting the favicon.ico file after creating an app with version 0.2.0 and got this error:

Error: HtmlWebpackPlugin: could not load file favicon.ico

  - index.js:303 
    [000]/[react-scripts]/[html-webpack-plugin]/index.js:303:27

(omitted stack trace for brevity)

@gaearon
Copy link
Contributor

gaearon commented Jul 29, 2016

Please see #108.
Deleting it is not currently supported.
If we add this, we will do this as part of #28 in the future.

@calebmer
Copy link
Author

Is there a reason why you don't support the ability to delete it? From #108 the reason I saw was it made it clear where the favicon should go, but if the user makes the conscious decision to remove it that should be fine from an educational perspective?

I'd like to remove it for two reasons:

  1. It's very reminiscent of a dot file given its placement at the root directory. Because I'm not a fan of including dot files/configs with no explicit purpose my first reaction is to delete it.
  2. I don't appreciate the forced branding aspect. When I start work on a project I don't usually have a logo, so I can't replace the favicon.ico, but I'd still like to hide React branding from the end user. If I can't delete the favicon, the only option is to replace it which is a rabbit hole of its own.

Thanks for the project though, it's an amazing productivity boost and the constraints were very well selected. This just made me a little frustrated 😉

@gaearon
Copy link
Contributor

gaearon commented Jul 30, 2016

I think the reason is explained here: #108 (comment).

We want to figure out how to make it work so that the user can add apple touch icons and other assets to HTML. Not just a favicon.

Currently favicon is treated magically. If we let you remove it, you might think it worked because it was in root directory and referenced from HTML. So you might delete it but that will be your mental model, and you might later try adding it with a few more files like apple touch icons but they won't work.

I want to make sure we have a good story about including "additional" files as part of the build. When we figure out how to do it, favicon will probably be treated just like another file, and you will be able to add and delete it at any time. Until we do, I'd like to treat it as a required file so you at least now it is handled specially—until it's not.

@gaearon gaearon added this to the 0.3.0 milestone Jul 30, 2016
@calebmer
Copy link
Author

Sounds good 👍

@MarcelMichau
Copy link

MarcelMichau commented Aug 1, 2016

I don't know whether this is the right place to suggest this, but I've used https://github.com/jantimon/favicons-webpack-plugin for a couple of projects when needing to support multiple device icons and it worked quite nicely.

The user could then opt in to automatically generated favicons by dropping a .png into a certain folder which the Webpack config looks at.

I haven't dug into the internals of create-react-app yet, so I'm not sure whether this is viable.

P.S. Good job on create-react-app btw. :)

@gaearon gaearon removed this from the 0.3.0 milestone Aug 4, 2016
andreypopp added a commit to andreypopp/create-react-app that referenced this issue Aug 12, 2016
gaearon pushed a commit that referenced this issue Aug 12, 2016
* Load favicon through html-loader.

Fixes #291.

* Add test for *.ico in e2e test suite

* Configure html-loader to process <link href="...">

* Address feedback on html-loader inclusion.

* Place favicon.ico at the root of the build dir

* Make comment style consistent between prod and dev webpack configs

* Fix html-loader config in dev mode
@calebmer
Copy link
Author

🎉

@gaearon
Copy link
Contributor

gaearon commented Sep 2, 2016

Fix is out in 0.3.0.

stayradiated pushed a commit to stayradiated/create-react-app that referenced this issue Sep 7, 2016
* Load favicon through html-loader.

Fixes facebook#291.

* Add test for *.ico in e2e test suite

* Configure html-loader to process <link href="...">

* Address feedback on html-loader inclusion.

* Place favicon.ico at the root of the build dir

* Make comment style consistent between prod and dev webpack configs

* Fix html-loader config in dev mode
feiqitian pushed a commit to feiqitian/create-react-app that referenced this issue Oct 25, 2016
* Load favicon through html-loader.

Fixes facebook#291.

* Add test for *.ico in e2e test suite

* Configure html-loader to process <link href="...">

* Address feedback on html-loader inclusion.

* Place favicon.ico at the root of the build dir

* Make comment style consistent between prod and dev webpack configs

* Fix html-loader config in dev mode
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants