LoginSignup
0
0

More than 1 year has passed since last update.

「gatsby-plugin-sitemap」が、突然buildでこけた時の対処

Last updated at Posted at 2021-07-14

お疲れ様です。

しばらくGatsbyJSの2系で、サイトを作成してました。
当然、「gatsby-plugin-sitemap」は使いますよね:grinning:

バージョンはこんな感じで。

package.json
"gatsby-plugin-sitemap": "^4.1.0",

gatsby-config.js
{
    resolve: `gatsby-plugin-sitemap`,
    options: {
        exclude:[`/draft/`],
    },
   },

みたいに書いてたわけです。
先日、Gatsby version: 3.4.1にアップデートして新たに別サイトを作成しました。

すると以下のエラーでbuildがこけるようになりました。
プラグインのバージョンは、"gatsby-plugin-sitemap": "^4.1.0"指定で変更ありません。

突然こけたわけでは無いのですが、心証としては「突然」なわけでして・・。
何?これ。

"gatsby-plugin-sitemap" threw an error while running the onPostBuild lifecycle:

Body must be a string. Received: undefined.
〜
File: node_modules/gatsby-plugin-sitemap/gatsby-node.js:40:20

しばらく悩みましたが、githubのissueに回答がありました。

gatsby-config.js
{
    resolve: `gatsby-plugin-sitemap`,
    options: {
        excludes:[`/draft/`],
    },
   },

・・・・「exclude」が「excludes」に変更になってました。

なんかね・・えぇ。
自分が悪いんですが、ぱっと流して読んでると気づかなかったので、備忘録として投稿いたしました。

う〜ん。
最近モヤモヤが増えてきたきがする・・・・Gatsby。

それでは。また。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0