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 doesn't allow app shortcuts

See original GitHub issue

Description

Adding app shortcuts to the plugin options in gatsby-plugin-manifest 2.5.0+ results in an Invalid plugin options error

I think this was caused by enabling ‘plugin option validation’, released in #27437 and published in 2.5.0 of gatsby-plugin-manifest. The new options validation doesn’t include the shortcuts option. It worked before 2.5.0 - I’ve just upgraded from 2.4.21 where it was working.

Steps to reproduce

  1. Install gatsby-plugin-manifest 2.5.0
  2. Add shortcuts to the plugin’s options:
// gatsby-config.s
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
+        shortcuts: [
+          { name: "Topics A to Z", url: "/topics/?utm_source=a2hs&utm_medium=shortcuts", }
+        ]
      }
    }
  ]
}

Expected result

Shortcuts are added to the generated manifest.webmanifest

Actual result

You get the following CLI error:

error Invalid plugin options for “gatsby-plugin-manifest”: “shortcuts” is not allowed

Environment

System: OS: Windows 10 10.0.19041 CPU: (4) x64 Intel® Core™ i7-5500U CPU @ 2.40GHz Binaries: Node: 12.16.3 - C:\Program Files\nodejs\node.EXE Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD Languages: Python: 2.7.11 Browsers: Chrome: 86.0.4240.183 Edge: Spartan (44.19041.423.0) npmPackages: gatsby: ^2.25.3 => 2.25.3 gatsby-plugin-catch-links: ^2.3.15 => 2.3.15 gatsby-plugin-eslint: ^2.0.8 => 2.0.8 gatsby-plugin-google-tagmanager: ^2.4.0 => 2.4.0 gatsby-plugin-manifest: ^2.5.2 => 2.5.2 gatsby-plugin-offline: ^3.3.2 => 3.3.2 gatsby-plugin-preact: ^4.0.16 => 4.0.16 gatsby-plugin-prefetch-google-fonts: ^1.4.3 => 1.4.3 gatsby-plugin-react-helmet: ^3.3.14 => 3.3.14 gatsby-plugin-sass: ^2.4.2 => 2.4.2 gatsby-plugin-sitemap: ^2.5.1 => 2.5.1 gatsby-plugin-split-css: ^1.0.2 => 1.0.2 gatsby-plugin-typescript: ^2.5.0 => 2.5.0 gatsby-react-router-scroll: 3.0.0 => 3.0.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
barbalexcommented, Nov 10, 2020

@mxstbr I wish I could build such a big code base with so few (noticeable) bugs. Congrats and thanks for an overall astoundingly great job!

2reactions
mxstbrcommented, Nov 10, 2020

Not a breaking change, simply an oversight bug! Sorry about the troubles, looking forward to your PR @ediblecode 🙏 The code for this is in gatsby-plugin-manifest’s gatsby-node.js.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gatsby-plugin-manifest
The web app manifest (part of the PWA specification) enabled by this plugin allows users to add your site to their home screen...
Read more >
Add shortcut icon to a Gatsby site
I'm creating a site with gatsby.js and I'm almost done, and I'd like to add shortcut icon but I don't know how.
Read more >
Top 5 gatsby-core-utils Code Examples
To help you get started, we've selected a few gatsby-core-utils examples, based on popular ways it is used in public projects. Secure your...
Read more >
Web Application Manifest
4 Creating shortcuts. This section is non-normative. In the following example, the developer has included two shortcuts. Assuming the manifest's ...
Read more >
How I broke Gatsby JS conditional page build and learned to ...
Starting the build process again with no change in… ... We see that this code part of the gatsby-plugin-sharp is activated by the...
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