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

fix(gatsby-plugin-sitemap): Add plugin options forbidden for deprecated exclude #32509

Merged
merged 4 commits into from
Aug 4, 2021

Conversation

orta
Copy link
Contributor

@orta orta commented Jul 26, 2021

In gatsby-plugin-sitemap 3 - > 4 exclude turned into excludes but the error message looked like:

Error: Body must be a string. Received: undefined.

For the old config. Given that most people would probably upgrade like I did via "Gatsby 2->3" and all libraries with it, I read the migration for Gatsby but not each official plugin.

I resisted the temptation to randomly duckduckgo for the error message on this one for a while, but the message was a red herring. Eventually I gave up and found #31416 (comment) - so this should give a better error message for folks migrating.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 26, 2021
@LekoArts LekoArts added topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 4, 2021
@LekoArts
Copy link
Contributor

LekoArts commented Aug 4, 2021

Thanks for the PR!

I've changed it to use our Plugin Options API: https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/configuring-usage-with-plugin-options/

We've got a section on deprecating options there (sadly it wasn't done in the initial PR): https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/configuring-usage-with-plugin-options/#deprecating-options

It'll then also immediately fail:

ERROR #11331  PLUGIN

Invalid plugin options for "gatsby-plugin-sitemap":

- As of v4 the `exclude` option was renamed to `excludes`

not finished open and validate gatsby-configs, load plugins - 0.256s

error Command failed with exit code 1.

@LekoArts LekoArts changed the title Adds support for better error messaging when updating gatsby-plugin-sitemap fix(gatsby-plugin-sitemap): Add plugin options forbidden for deprecated exclude Aug 4, 2021
@LekoArts LekoArts merged commit 6f60237 into gatsbyjs:master Aug 4, 2021
@orta
Copy link
Contributor Author

orta commented Aug 5, 2021

Works for me, thanks!

@luckpot207
Copy link

I m in cli command: gatsby develop
then some error happenend

warn Plugin gatsby-source-hubspot is not compatible with your gatsby version 4.1.3 - It requires gatsby@<3.0.0

ERROR #11331 PLUGIN

Invalid plugin options for "gatsby-source-prismic":

  • gatsby-source-prismic(ellipsis-drive) - JSON model for "episode" is missing. If the Custom Type is no longer in use, you
    may provide "{}" as the JSON model.
  • gatsby-source-prismic(ellipsis-drive) - JSON model for "article_cta" is missing. If the Custom Type is no longer in use,
    you may provide "{}" as the JSON model.

not finished open and validate gatsby-configs, load plugins - 1.543s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: plugins Related to plugin system, themes & catch-all for plugins that don't have a label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants