我已经决定建立我自己的博客,并选择埃玛苏里亚诺的盖茨比初学者伙伴作为我的盖茨比初学者(我是绝对新鲜的盖茨比和满足!)
我做了所有告诉我的事情,设置我的环境,设置内容空间,登录到内容丰富的等等。
目前,我在Ubuntu 18.04和
$ gatsby --version
Gatsby CLI version: 2.10.10
Gatsby version: 2.19.45
$ contentful --version
1.2.14下面的一切都毫无问题地成功了。
$ gatsby new mate-portfolio https://github.com/EmaSuriano/gatsby-starter-mate
$ yarn setup但当我
$ yarn start然后输入localhost:8000个我得到的无法编译包含大量错误的页面。
我引用了这个https://github.com/gatsbyjs/gatsby/issues/16455问题来解决我的问题,并尝试了可用的解决方案,例如
我还安装了$ npm install --save gatsby-source-contentful。$ yarn add gatsby和$ yarn global add contentful-cli也一样。
但他们都没用。下面是我在localhost上显示的错误:当我$ yarn start时是8000。
有人能帮我解决这个问题吗?非常感谢!
There was an error in your GraphQL query:
Unknown type "ContentfulFixed".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulFixed".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulFluid".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulFluid".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulResolutions".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulResolutions".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulResolutions".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulSizes".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulSizes".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Unknown type "ContentfulSizes".
File: /blog/node_modules/gatsby-source-contentful/src/fragments.js
There was an error in your GraphQL query:
Cannot query field "contentfulAbout" on type "Query".
If you don't expect "contentfulAbout" to exist on the type "Query" it is most likely a typo.
However, if you expect "contentfulAbout" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "contentfulAbout" 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 a least one entry with that field ("dummy content")
It 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":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/components/Helmet.js
There was an error in your GraphQL query:
Cannot query field "contentfulAbout" on type "Query".
If you don't expect "contentfulAbout" to exist on the type "Query" it is most likely a typo.
However, if you expect "contentfulAbout" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "contentfulAbout" 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 a least one entry with that field ("dummy content")
It 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":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/components/Footer.js
There was an error in your GraphQL query:
Cannot query field "contentfulAbout" on type "Query".
If you don't expect "contentfulAbout" to exist on the type "Query" it is most likely a typo.
However, if you expect "contentfulAbout" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "contentfulAbout" 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 a least one entry with that field ("dummy content")
It 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":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/sections/Landing.js
There was an error in your GraphQL query:
Cannot query field "siteMetadata" on type "Site".
If you don't expect "siteMetadata" to exist on the type "Site" it is most likely a typo.
However, if you expect "siteMetadata" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "siteMetadata" 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 a least one entry with that field ("dummy content")
It 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 "Site":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/sections/Landing.js
There was an error in your GraphQL query:
Cannot query field "contentfulAbout" on type "Query".
If you don't expect "contentfulAbout" to exist on the type "Query" it is most likely a typo.
However, if you expect "contentfulAbout" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "contentfulAbout" 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 a least one entry with that field ("dummy content")
It 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":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/sections/Projects.js
There was an error in your GraphQL query:
Cannot query field "siteMetadata" on type "Site".
If you don't expect "siteMetadata" to exist on the type "Site" it is most likely a typo.
However, if you expect "siteMetadata" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "siteMetadata" 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 a least one entry with that field ("dummy content")
It 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 "Site":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/sections/Writing.js
There was an error in your GraphQL query:
Cannot query field "allMediumPost" on type "Query".
If you don't expect "allMediumPost" to exist on the type "Query" it is most likely a typo.
However, if you expect "allMediumPost" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "allMediumPost" 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 a least one entry with that field ("dummy content")
It 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":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/sections/Writing.js
There was an error in your GraphQL query:
Cannot query field "mediumUser" on type "Query".
If you don't expect "mediumUser" to exist on the type "Query" it is most likely a typo.
However, if you expect "mediumUser" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "mediumUser" 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 a least one entry with that field ("dummy content")
It 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":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/sections/Writing.js
There was an error in your GraphQL query:
Cannot query field "contentfulAbout" on type "Query".
If you don't expect "contentfulAbout" to exist on the type "Query" it is most likely a typo.
However, if you expect "contentfulAbout" to exist there are a couple of solutions to common problems:
- 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
- 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
- You want to optionally use your field "contentfulAbout" 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 a least one entry with that field ("dummy content")
It 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":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions
File: /blog/src/sections/About.js发布于 2020-04-05 22:27:04
我是那个包裹的维护者。我在使用不同版本的依赖项,检查它们是如何一起工作的,我发现,碰到gatsby的版本实际上就是它破坏了项目。
请检查您正在使用的版本"gatsby": "2.15.22",在您的package.json,yarn.lock和node_modules。
希望能帮上忙!
发布于 2020-03-20 08:26:59
发布于 2020-05-04 06:06:53
确保您在contenful中为每个内容类型都有一个条目。包括资产。在这条线中,这似乎是许多人的问题。
https://stackoverflow.com/questions/60716044
复制相似问题