この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
あなたの回答
tips
プレビュー