Closed Notaduck closed 6 years ago
Favicons generation is a two steps process. First, favicons and manifests are generated in the public
folder with a .iconstats.json
file listing all the needed data that will be appended to the HTML. Then, it appends generated HTML to all HTML files using this file. Gatsby handles when to execute these steps.
It seems that .iconstats.json
has not been generated or is not in the right folder. Can you check if you find this file somewhere in the gatsby build folder (public
) and if the path where you find it is consistent with the one displayed in the error?
I doesn't look like .iconstats.json
is in my build dir.
find ./ -name ".iconstats.json"
didn't find anything
Can you try clearing cache and public folders from Gatsby?
So I did a rm -rf .cache/*
and rm -rf .public/*
and I do still get the same results
Are you using Gatsby v2? The last major version of this plugin is only compatible with Gatsby v2.
Had the same issue, looked at some other Gatsby Projects I had and I went back to 2.1.1 which doesn't have that issue. @julien1619 Do you know which version was the last one for the current (not V2) version of Gatsby?
@julien1619 thanks! That was the issue, I'm currently running version 1.9.277
However I think it would be a good idea to make it clear which version that the plugin works with. It looks like 3.1.1 should work with 1.9.277 (see Runkit+npm).
In fact you should have a warning issued by npm while installing this dependency thanks to the peerDependencies
configuration. Do you confirm?
I can, I missed that one sry.
No problem, thank you for the report anyway. I'll check how to quickly improve the information about it.
you could just make a required gatsby version in the readme ;) In the matter of fact I think evey gatsby plugin should have that to make it more user friendly
Indeed, let's keep it simple ^^ An update is coming today, I'll update the Readme in the meantime.
Simple is good ;) will the update support v1 ?
Didn't plan to do so first, but finally it was easier than I thought :) Can you test the develop branch? If it's ok, I'll release it today.
yes ofc, but you have to guide me here ;)
I haven't installed a dev. version before, how should that be done yarn add gatsby-plugin-favicon@develop
can only see 3.1.2 as the latest version
@julien1619 how do i use this for the latest gatsby and not the alpha version?
--
EDIT
alternatively, I used react-helmet
and added the link to the favicon there
@notaduck In fact another user and my colleague tested it and I'm still having a bug because of the way Gatsby was building things on v1. Can't see for now how to fix it.
@ToJen In your package.json you just have to remove the plugin and add it again at the right version.
npm remove gatsby-plugin-favicon
npm install gatsby-plugin-favicon@2.1.1 --save
gets trough with deleting .cache/* thanks @julien1619
I've just installed the
gatsby-plugin-favicon
but I get thisWebpackError: ENOENT: no such file or directory, open '/home/daniel/Projects/personal_blog/public/.iconstats.json'
error when I try to build the project?