gatsby-plugin-manifest not working

Created on 25 Jul 2018  路  12Comments  路  Source: gatsbyjs/gatsby

same setup with #6698, installed the next version, checked the migration guide and nothing works except tons of uninformative error.

image

Double checked with the guide and make sure the images are in correct position.
Here is my gatsby-config.js

    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: "GatsbyJS",
        short_name: "GatsbyJS",
        start_url: "/",
        background_color: "#f7f0eb",
        theme_color: "#a2466c",
        display: "minimal-ui",
        icon: "src/images/favicon.png", // This path is relative to the root of the site.
      },
    },

basically, every plugin that is on v2 does not appears to be working for me. Not sure if it is all linked together to the root cause or not.

Most helpful comment

The manifest only gets generated when you run gatsby build so if you run that first, then gatsby develop you wont see the 404 in development mode.

All 12 comments

Try deleting your node_modules and .cache folder and reinstalling the packages. Do you have a sample repo?

hi. I have deleted my node_modules and .cache folder and reinstalling the package by npm install.
Nothing works.

My repo: https://github.com/khmy2010/kehan.com

The manifest only gets generated when you run gatsby build so if you run that first, then gatsby develop you wont see the 404 in development mode.

@khmy2010 did you get it to work? I'm currently having same issues as mentioned in #6830

Wow that was fast I got it working by commenting gatsby-plugin-favicon & clearing build cache in Netlify since I'm using gatsby-plugin-netlify-cache

Thanks @dbrookes for pointing out the solution.

I have figure this out by simply running gatsby build before gatsby develop

I just went through the documentation again and realised that I miss the important line:

This plugin configures Gatsby to create a manifest.webmanifest file on every site build.

Every Site Build actually means gatsby build, which I thought it was gatsby develop.

The issue was resolved. Thank you for the inputs

Work fine on netlify with version 2.0.5 bit not with 2.0.10 (lastest version atm).

You can just change your package.json to "gatsby-plugin-manifest": "2.0.5" for a quick fix :)

My issue: the manifest.json file is created, but inside the public/icons/ directory there's another manifest that is picked up - and this one contains wrong information. Why is it created and how do I change it?

Quick question? When deploying on Netlify, they pretty much handle 'gatsby build' for you so I don't need to build the site prior to deploying it for the manifest plugin to work correct?

Having same issue as @lucavallin
"gatsby-plugin-manifest": "^2.2.34"

Have tried clearing node modules and cache but still have issue, additional manifest created in icons folder is picked up and uses the package.json name instead of my site name

On closer inspection I think this is most likely due to gatsby-plugin-favicon which is also in my project. Issue raised here: https://github.com/Creatiwity/gatsby-plugin-favicon/issues/66

for anyone wondering what's the actual solution:

  • make sure your gatsby-config is properly set for pathPrefix, e.g. pathPrefix: '/foobar'
  • run gatsby build --prefix-paths or PREFIX_PATHS=1 gatsby build
  • in the gatsby-plugin-manifest config you could use start_url: '.'

that will build the html with the right base paths for all resources

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

totsteps picture totsteps  路  3Comments

ghost picture ghost  路  3Comments

dustinhorton picture dustinhorton  路  3Comments