質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Contentful

Contentfulは、グラフィカルなUIを提供しないAPIベースのヘッドレスCMSです。従来のCMSと異なり、ディスクトップやモバイルを始めとするさまざまなプラットフォームへのコンテンツ配信が可能なAPIが用意されています。

Gatsby

Gatsbyとは、Reactベースの静的サイトジェネレータ。最新のフロントエンド技術を活かし、機能豊富なWebサイトやアプリケーションを作ることが可能です。GraphQLを用いてあらゆるソースからサイトのデータを取得。指定した設定に基づいて静的サイトを構築することができます。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

Q&A

0回答

1141閲覧

gatsby jsでキャッシュ周りのエラーの対処法

sequelanonymous

総合スコア123

Contentful

Contentfulは、グラフィカルなUIを提供しないAPIベースのヘッドレスCMSです。従来のCMSと異なり、ディスクトップやモバイルを始めとするさまざまなプラットフォームへのコンテンツ配信が可能なAPIが用意されています。

Gatsby

Gatsbyとは、Reactベースの静的サイトジェネレータ。最新のフロントエンド技術を活かし、機能豊富なWebサイトやアプリケーションを作ることが可能です。GraphQLを用いてあらゆるソースからサイトのデータを取得。指定した設定に基づいて静的サイトを構築することができます。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

0グッド

0クリップ

投稿2022/01/14 14:22

このURLの通りにサンプルブログをつくろうとしていますが、下記のようなエラーがでてしまいます。

gatsby cleanをやったり、違うversionにしてみたり、npm install --save core-js@3を実行してみたりしていますが、かわらず、エラーが解消されません。解決方法についてなにかご存知のかたいましたらご教示いただけませんでしょうか?

$ gatsby -v Gatsby CLI version: 4.4.0 Gatsby version: 2.32.13 $ node -v v15.12.0

console

1 ~/gatsbyjs-and-contentful (master) $ gatsby develop 2... 3... 4success building schema - 0.765s 5 6 ERROR #85923 GRAPHQL 7 8There was an error in your GraphQL query: 9 10Cannot query field "allContentfulBlogPost" on type "Query". 11 12If you don't expect "allContentfulBlogPost" to exist on the type "Query" it is most likely a typo. 13However, if you expect "allContentfulBlogPost" to exist there are a couple of solutions to common problems: 14 15- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server 16- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have 17- You want to optionally use your field "allContentfulBlogPost" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add at least one entry with that field 18("dummy content") 19 20It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query": 21https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions 22 23File: gatsby-node.js:7:10 24 25[ 26 GraphQLError: Cannot query field "allContentfulBlogPost" on type "Query". Did you mean "allContentfulBlog", "allContentfulAsset", "contentfulBlog", "contentfulAsset", or "allContentfulContentType"? 27 at Object.Field (/Users/xxxx/gatsbyjs-and-contentful/node_modules/graphql/validation/rules/FieldsOnCorrectType.js:53:31) 28 at Object.enter (/Users/xxxx/gatsbyjs-and-contentful/node_modules/graphql/language/visitor.js:324:29) 29 at Object.enter (/Users/xxxx/gatsbyjs-and-contentful/node_modules/graphql/language/visitor.js:375:25) 30 at visit (/Users/xxxx/gatsbyjs-and-contentful/node_modules/graphql/language/visitor.js:242:26) 31 at validate (/Users/xxxx/gatsbyjs-and-contentful/node_modules/graphql/validation/validate.js:73:24) 32 at GraphQLRunner.validate (/Users/xxxx/gatsbyjs-and-contentful/node_modules/gatsby/src/query/graphql-runner.ts:98:22) 33 at GraphQLRunner.query (/Users/xxxx/gatsbyjs-and-contentful/node_modules/gatsby/src/query/graphql-runner.ts:162:25) 34 at /Users/xxxx/gatsbyjs-and-contentful/node_modules/gatsby/src/bootstrap/create-graphql-runner.ts:59:8 35 at /Users/xxxx/gatsbyjs-and-contentful/gatsby-node.js:10:7 36 at Promise._execute (/Users/xxxx/gatsbyjs-and-contentful/node_modules/bluebird/js/release/debuggability.js:384:9) 37 at Promise._resolveFromExecutor (/Users/xxxx/gatsbyjs-and-contentful/node_modules/bluebird/js/release/promise.js:518:18) 38 at new Promise (/Users/xxxx/gatsbyjs-and-contentful/node_modules/bluebird/js/release/promise.js:103:10) 39 at Object.exports.createPages (/Users/xxxx/gatsbyjs-and-contentful/gatsby-node.js:7:10) 40 at runAPI (/Users/xxxx/gatsbyjs-and-contentful/node_modules/gatsby/src/utils/api-runner-node.js:485:22) 41 at Promise.catch.decorateEvent.pluginName (/Users/xxxx/gatsbyjs-and-contentful/node_modules/gatsby/src/utils/api-runner-node.js:636:13) 42 at Promise._execute (/Users/xxxx/gatsbyjs-and-contentful/node_modules/bluebird/js/release/debuggability.js:384:9) { 43 locations: [ [Object] ] 44 } 45] 46 47 ERROR 48 49(node:36842) Warning: a promise was rejected with a non-error: [object Array] 50(Use `node --trace-warnings ...` to show where the warning was created) 51 52 53 ERROR #11321 PLUGIN 54 55"gatsby-node.js" threw an error while running the createPages lifecycle: 56 57Cannot read property 'allContentfulBlogPost' of undefined 58 59 27 | } 60 28 | 61> 29 | const posts = result.data.allContentfulBlogPost.edges 62 | ^ 63 30 | posts.forEach((post, index) => { 64 31 | createPage({ 65 32 | path: `/blog/${post.node.slug}/`, 66 67File: gatsby-node.js:29:35 68 69 70... 71... 72... 73 74File: src/templates/blog-post.js:56:5 75 76failed extract queries from components - 1.151s 77success write out requires - 0.016s 78success run page queries - 0.063s - 1/1 15.86/s 79 80 ERROR #98124 WEBPACK 81 82Generating development JavaScript bundle failed 83 84Can't resolve 'core-js/modules/web.dom.iterable.js' in '/Users/xxxx/gatsbyjs-and-contentful/.cache' 85 86If you're trying to use a package make sure that 'core-js/modules/web.dom.iterable.js' is installed. If you're trying to use a local file make sure that the path is correct. 87 88File: .cache/app.js 89 90 91 ERROR #98124 WEBPACK 92 93Generating development JavaScript bundle failed 94 95Can't resolve 'core-js/modules/web.dom.iterable.js' in '/Users/xxxx/gatsbyjs-and-contentful/.cache' 96 97If you're trying to use a package make sure that 'core-js/modules/web.dom.iterable.js' is installed. If you're trying to use a local file make sure that the path is correct. 98 99File: .cache/dev-loader.js 100 101 102 ERROR #98124 WEBPACK 103 104Generating development JavaScript bundle failed 105 106Can't resolve 'core-js/modules/web.dom.iterable.js' in '/Users/xxxx/gatsbyjs-and-contentful/.cache' 107 108If you're trying to use a package make sure that 'core-js/modules/web.dom.iterable.js' is installed. If you're trying to use a local file make sure that the path is correct. 109 110File: .cache/loader.js 111 112 113 ERROR #98124 WEBPACK 114 115Generating development JavaScript bundle failed 116 117Can't resolve 'core-js/modules/web.dom.iterable.js' in '/Users/xxxx/gatsbyjs-and-contentful/.cache' 118 119If you're trying to use a package make sure that 'core-js/modules/web.dom.iterable.js' is installed. If you're trying to use a local file make sure that the path is correct. 120 121File: .cache/find-path.js 122 123 124 ERROR #98124 WEBPACK 125 126Generating development JavaScript bundle failed 127 128Can't resolve 'core-js/modules/web.dom.iterable.js' in '/Users/xxxx/gatsbyjs-and-contentful/.cache' 129 130If you're trying to use a package make sure that 'core-js/modules/web.dom.iterable.js' is installed. If you're trying to use a local file make sure that the path is correct. 131 132File: .cache/navigation.js 133 134failed Building development bundle - 12.307s

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問