Skip to content

Build fails when favicon is missing #291

Closed
@calebmer

Description

@calebmer

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)

Activity

gaearon

gaearon commented on Jul 29, 2016

@gaearon
Contributor

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

calebmer commented on Jul 30, 2016

@calebmer
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

gaearon commented on Jul 30, 2016

@gaearon
Contributor

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.

added this to the 0.3.0 milestone on Jul 30, 2016
calebmer

calebmer commented on Jul 31, 2016

@calebmer
Author

Sounds good 👍

MarcelMichau

MarcelMichau commented on Aug 1, 2016

@MarcelMichau

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. :)

removed this from the 0.3.0 milestone on Aug 4, 2016
added a commit that references this issue on Aug 12, 2016
9c21c40
added a commit that references this issue on Aug 12, 2016
60178ac
calebmer

calebmer commented on Aug 13, 2016

@calebmer
Author

🎉

gaearon

gaearon commented on Sep 2, 2016

@gaearon
Contributor

Fix is out in 0.3.0.

added a commit that references this issue on Sep 7, 2016
d295979
added a commit that references this issue on Oct 25, 2016
799131f
locked and limited conversation to collaborators on Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gaearon@MarcelMichau@calebmer

        Issue actions

          Build fails when favicon is missing · Issue #291 · facebook/create-react-app