gatsby-plugin-favicon: WebPackError: ENOENT: no such file or directory /public/.iconstats.json'

I’ve just installed the gatsby-plugin-favicon but I get this WebpackError: ENOENT: no such file or directory, open '/home/daniel/Projects/personal_blog/public/.iconstats.json' error when I try to build the project?

module.exports = {
	plugins: [
		{
			resolve: `gatsby-plugin-favicon`,
			options: {
				logo: "./src/images/rev4_cropped.png",

				// WebApp Manifest Configuration
				appName: 'Gatsby site',
				appDescription: null,
				developerName: null,
				developerURL: null,
				dir: 'auto',
				lang: 'en-US',
				background: '#fff',
				theme_color: '#fff',
				display: 'standalone',
				orientation: 'any',
				start_url: '/',
				version: '1.0',

				icons: {
					android: true,
					appleIcon: true,
					appleStartup: true,
					coast: false,
					favicons: true,
					firefox: true,
					opengraph: false,
					twitter: false,
					yandex: false,
					windows: false
				}
			}
		},
		'gatsby-plugin-robots-txt',
		'gatsby-remark-copy-linked-files',
		'gatsby-transformer-sharp',
		'gatsby-plugin-sharp',
		'gatsby-plugin-styled-components',
		{
			resolve: 'gatsby-transformer-remark',
			options: {
				plugins: [
					'gatsby-remark-katex',
					{
						resolve: 'gatsby-remark-images',
						options: {
							maxWidth: 1080 
						}
					},
					{
						resolve: 'gatsby-remark-prismjs',
						options: {
							// Class prefix for <pre> tags containing syntax highlighting;
							// defaults to 'language-' (eg <pre class="language-js">).
							// If your site loads Prism into the browser at runtime,
							// (eg for use with libraries like react-live),
							// you may use this to prevent Prism from re-processing syntax.
							// This is an uncommon use-case though;
							// If you're unsure, it's best to use the default value.
							classPrefix: "language-",
							// This is used to allow setting a language for inline code
							// (i.e. single backticks) by creating a separator.
							// This separator is a string and will do no white-space
							// stripping.
							// A suggested value for English speakers is the non-ascii
							// character '›'.
							inlineCodeMarker: null,
							// This lets you set up language aliases.  For example,
							// setting this to '{ sh: "bash" }' will let you use
							// the language "sh" which will highlight using the
							// bash highlighter.
							aliases: {sh: "bash"},
						}
					}
				]
			}
		},
		'gatsby-plugin-react-helmet',
		'gatsby-plugin-sass',
		{
			resolve: 'gatsby-source-filesystem',
			options: {
				path: `${__dirname}/src/pages`,
				name: 'pages'
			}
		},
		{
			resolve: 'gatsby-source-filesystem',
			options: {
				path: `${__dirname}/src/images`,
				name: 'images'
			}
		},
		{
			resolve: 'gatsby-plugin-eslint',
			options: {
				test: /\.js$|\.jsx$/,
				exclude: /(node_modules|cache|public)/,
				options: {
					emitWarning: true,
					failOnError: false
				}
			}
		},
		{
			resolve: `gatsby-plugin-google-analytics`,
			options: {
				trackingId: "UA-xxxxxxxxxxxxxxxxx-2",
				// Puts tracking script in the head instead of the body
				head: true,
				// Setting this parameter is optional
				anonymize: true,
				// Setting this parameter is also optional
				respectDNT: true,
				// Avoids sending pageview hits from custom paths
				exclude: ["/preview/**", "/do-not-track/me/too/"],
			},
		},
		{
			resolve: 'gatsby-plugin-sitemap'
		},
	],

	siteMetadata: {
		author: 'xxxxxxxxxxxxxxxxx',
		title: 'xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx',
		name:"google-site-verification",
		content:"Ji_Q-xxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxx",
		siteUrl: "https://xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx"
	},
	// pathPrefix: '/personal_blog'
};

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

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?

Can you try clearing cache and public folders from Gatsby?