Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-plugin-manifest] Buggy output (manifest file and images) #13055

Closed
pikeas opened this issue Apr 2, 2019 · 5 comments
Closed

[gatsby-plugin-manifest] Buggy output (manifest file and images) #13055

pikeas opened this issue Apr 2, 2019 · 5 comments
Labels
help wanted Issue with a clear description that the community can help with. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@pikeas
Copy link

pikeas commented Apr 2, 2019

Description

  1. gatsby-plugin-manifest fails to create images when paths are different.
  2. gatsby-plugin-manifest does not delete the include_favicon option when creating the manifest file.

Steps to reproduce

# gatsby-config.js
module.exports = {
  ...
  plugins: [
    ...
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `foo`,
        short_name: `bar`,
        start_url: `/?utm_source=homescreen`,
        background_color: `#111111`,
        display: `minimal-ui`,
        icon: `src/images/gatsby-icon.png`,
        include_favicon: false,
        legacy: false,
        theme_color_in_head: false,
        icons: [
          {
            src: `favicon.ico`,
            sizes: `32x32`,
            type: `image/ico`,
          },
          {
            src: `icons/icon-192x192.png`,
            sizes: `192x192`,
            type: `image/png`,
          },
        ],
      },
    },
    ...
  ],
}
$ rm -rf public && gatsby build
...
Generating image thumbnails [==============================] 6/6 0.3 secs 100%
error Plugin gatsby-plugin-manifest returned an error

  Error: vips__file_open_write: unable to open file "public/icons/icon-192x192.png" for writing
  unix error: No such file or directory

This happens because of https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-manifest/src/gatsby-node.js#L72-L73

For the include_favicon issue, this is because that option is not listed at https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-manifest/src/gatsby-node.js#L46-L55

Expected result

  1. The plugin should create the images.
  2. The option should not be present in the final output.

Actual result

See description.

Environment

System:
OS: macOS 10.14.2
Shell: 3.0.2 - /usr/local/bin/fish
Binaries:
Node: 10.15.3 - ~/.asdf/installs/nodejs/10.15.3/bin/node
npmPackages:
gatsby: ^2.3.3 => 2.3.3
gatsby-image: ^2.0.35 => 2.0.35
gatsby-plugin-manifest: ^2.0.26 => 2.0.26
gatsby-plugin-offline: ^2.0.25 => 2.0.25
gatsby-plugin-postcss: ^2.0.7 => 2.0.7
gatsby-plugin-react-helmet: ^3.0.11 => 3.0.11
gatsby-plugin-sharp: ^2.0.32 => 2.0.32
gatsby-source-filesystem: ^2.0.28 => 2.0.28
gatsby-transformer-sharp: ^2.1.17 => 2.1.17
npmGlobalPackages:
gatsby-cli: 2.5.4

@pieh pieh added the type: bug An issue or pull request relating to a bug in Gatsby label Apr 3, 2019
@pieh
Copy link
Contributor

pieh commented Apr 3, 2019

Would you be interested in opening PR with fixes?

For the first issue seems like we need to iterate over icons array and not rely on all icons being set to be in same directory and the second one you spot-on identified.

@pikeas
Copy link
Author

pikeas commented Apr 3, 2019

@pieh I'm more of a Python dev than a JS dev so filing a full bug report and including the relevant lines is about the extent of how I can help. :-)

@pieh pieh added the help wanted Issue with a clear description that the community can help with. label Apr 3, 2019
@pieh
Copy link
Contributor

pieh commented Apr 3, 2019

That's fair ;) Thanks for helping identify faulty code that cause those bugs!

@me4502
Copy link
Contributor

me4502 commented Apr 3, 2019

I can put up a PR for this - I just noticed the include_favicon issue in my codebase

@me4502
Copy link
Contributor

me4502 commented Apr 3, 2019

#13059 made one

DSchau pushed a commit that referenced this issue Apr 9, 2019
## Description

gatsby-plugin-manifest fails to create images when paths are different.
~~gatsby-plugin-manifest does not delete the include_favicon option when creating the manifest file.~~

## Related Issues

Fixes #13055
johno pushed a commit to jlengstorf/gatsby that referenced this issue Apr 10, 2019
## Description

gatsby-plugin-manifest fails to create images when paths are different.
~~gatsby-plugin-manifest does not delete the include_favicon option when creating the manifest file.~~

## Related Issues

Fixes gatsbyjs#13055
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants