question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gatsby Plugin Manifest lacking clarity -> causing error

See original GitHub issue

Summary

The gatsby-manifest-plugin documentation for generating icons is unclear.

        icon: `src/images/favion.svg`, // This path is relative to the root of the site.
        icons: [
          {
            src: `src/images/favicon--short.svg`,
            sizes: `192x192`,
            type: `image/png`,
          },
        ],

I have added the above code to the gatsby-config.js. However when running gatsby develop or gatsby build the terminal throws the following error.

error "gatsby-plugin-manifest" threw an error while running the onPostBootstrap lifecycle:

ENOENT: no such file or directory, mkdir 'public/src/images'

  303 | 
  304 |                 if (!exists) {
> 305 |                   fs.mkdirSync(iconPath);
      |                      ^
  306 |                 }
  307 | 
  308 |                 paths[iconPath] = true;


  Error: ENOENT: no such file or directory, mkdir 'public/src/images'

The documentation has the favicons in a folder called favicons. The error implies these icon files should be inside the public folder. But this seems incorrect.

Any advice would be helpful, thankyou.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
LekoArtscommented, Nov 2, 2020

The icon option should point to a file relative to the root of your site inside the src folder.

The icons defined in the icons option however reference icons that will eventually be in the public folder. One puts these files there by placing them inside the static folder.

Example:

  1. https://github.com/LekoArts/gatsby-starter-minimal-blog/blob/master/gatsby-config.js#L55-L66
  2. https://github.com/LekoArts/gatsby-starter-minimal-blog/tree/master/static

The documentation/README at https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-manifest/README.md should include a note that icons is referring to the final URL and thus images need to be added to static.

1reaction
sijin-rajcommented, Dec 2, 2020

icons: [ { src: src/images/favion.svg, sizes: 192x192, type: image/png, },

    ],
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Common Errors - Gatsby
Errors using gatsby-plugin-image and sharp. Gatsby's image processing is broken up into different packages which need to work together to source images and ......
Read more >
Gatsby Changelog | 5.3.0
In PR #36623 we fixed this behavior and any node changes (either by changing local files or through webhook updates) will be reflected...
Read more >
How to install Clarity on Gatsby? - Microsoft Learn
From the Clarity dashboard, go to Settings. · From the left menu, click Setup. · Under Installation methods, select Install on third-party ...
Read more >
Why gatsby-plugin-manifest cannot resolve 'gatsby'?
Can you try deleting your node_modules folder, and install again? And yeah, it does need to be installed locally as well. But npm...
Read more >
apolllo graphql variable of type x was not provided - You.com
gatsby develop run without these errors - the $id is provided. ... 61.0.2 Safari: 11.1.2 npmPackages: gatsby: next => 2.0.0-rc.10 gatsby-plugin-manifest: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found