Gatsby: Gatsby Plugin Manifest lacking clarity -> causing error

Created on 31 Oct 2020  Β·  8Comments  Β·  Source: gatsbyjs/gatsby

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.

needs more info documentation

Most helpful comment

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.

All 8 comments

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.

I was thinking in include a note below the config but it was already described below the Manual mode config section

you are responsible for defining the entire web app manifest and providing the defined icons in the static folder.

so I just wrote some comments next to the src path like with the icon path

https://github.com/gatsbyjs/gatsby/pull/27892

Hiya!

This issue has gone quiet. Spooky quiet. πŸ‘»

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! πŸ’ͺπŸ’œ

 icons: [
          {
            src: `/android-chrome-192x192.png`,
            sizes: `192x192`,
            type: `image/png`,
          },
          {
            src: `/android-chrome-512x512.png`,
            sizes: `512x512`,
            type: `image/png`,
          },
        ],
      },
    },

@Anmol368 did you have a question/issue?

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

    ],

Hiya!

This issue has gone quiet. Spooky quiet. πŸ‘»

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! πŸ’ͺπŸ’œ

Done.

On Tue, 22 Dec 2020 at 18:11, Sijin raj notifications@github.com wrote:

Hi,
This is Sijin can i get few stickers from gatsby . please reply for this
mail

On Tue, 22 Dec 2020 at 17:40, github-actions[bot] <
[email protected]>
wrote:

Hiya!

This issue has gone quiet. Spooky quiet. πŸ‘»

We get a lot of issues, so we currently close issues after 60 days of
inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply
here.
As a friendly reminder: the best way to see this issue, or any other,
fixed is to open a Pull Request. Check out gatsby.dev/contribute
https://www.gatsbyjs.org/contributing/how-to-contribute/ for more
information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! πŸ’ͺπŸ’œ

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/gatsbyjs/gatsby/issues/27751#issuecomment-749509910
,
or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/AM7I7AHRFD7U72JLRNY2UUDSWCEERANCNFSM4TGC7ZPA

.

β€”
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/27751#issuecomment-749521451,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AM7I7AHIEPOHB3FGXKLICJDSWCHZFANCNFSM4TGC7ZPA
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  Β·  3Comments

andykais picture andykais  Β·  3Comments

brandonmp picture brandonmp  Β·  3Comments

3CordGuy picture 3CordGuy  Β·  3Comments

Oppenheimer1 picture Oppenheimer1  Β·  3Comments