Gatsby: 未知类型“ ContentfulFixed”。 您是说“ ContentfulBlogPost”,“ ContentfulContentType”还是“ ContentfulBlogPostEdge”吗?

创建于 2019-08-08  ·  69评论  ·  资料来源: gatsbyjs/gatsby

错误#85901 GRAPHQL

我试图从内容中获取我的博客,这给了我一个奇怪的错误。
我打开此问题的唯一原因是因为错误告诉我要这样做。

这就是错误的意思:
错误:无法获取此StaticQuery的结果。

“这可能是Gatsby中的错误,如果刷新页面无法解决问题,请在https://github.com/gatsbyjs/gatsby/issues中打开问题”

gatsby信息输出:

系统:
作业系统:Windows 10
CPU:(8)x64 Intel(R)Core(TM)i7-3632QM CPU @ 2.20GHz
二进制文件:
npm:6.9.0-C:\ Program Files \ nodejs \ npm.CMD
语言:
的Python:3.7.2
浏览器:
边缘:44.18362.1.0
npmPackages:
盖茨比:^ 2.13.51 => 2.13.51
gatsby-plugin-sass:^ 2.1.4 => 2.1.4
gatsby-plugin-sharp:^ 2.2.10 => 2.2.10
gatsby-remark-images:^ 3.1.7 => 3.1.7
gatsby备注相对图像:^ 0.2.3 => 0.2.3
gatsby-source-contentful:^ 2.1.18 => 2.1.18
gatsby源文件系统:^ 2.1.9 => 2.1.9
gatsby-transformer-remark:^ 2.6.11 => 2.6.11

错误无法拒绝

错误:系统找不到指定的路径。

  • envinfo.js:1 Function.e.exports.sync
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:4908

  • envinfo.js:1 Object.copySync
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:66886

  • envinfo.js:1 Object.t.writeSync
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:48715

  • envinfo.js:1
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:46872

  • envinfo.js:1
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:46887

  • task_queues.js:88 processTicksAndRejections
    内部/进程/task_queues.js:88:5

needs reproduction GraphQL bug

最有用的评论

对于具有相同错误的用户,我通过执行以下步骤解决了我的问题,而没有删除任何数据或降级任何程序包:

  1. 进入内容丰富的空间
  2. 点击“媒体”标签,然后将单个资产添加为虚拟图像以充当占位符
  3. 通过运行npm run developgatsby develop重新启动开发服务器

希望这也可以解决您的问题,但是如果有人可以启发我们为什么会这样,可能会有所帮助。

所有69条评论

嗨, @ EdinK1 ,您是否愿意为此代码库共享一个存储库,以便我们更深入地研究导致此错误的具体原因。 如果没有,您可以复制吗?

@lannonbr 。 当然,这是我的仓库的链接。 问题似乎来自gatsbty-source-contenful文件夹中的fragments.js。 我已经忽略了节点模块文件夹。 让我知道是否需要查看节点模块。

我也刚遇到这个错误。 我正在按照本教程https://www.youtube.com/watch?v=8t0vNu2fCCM&t=13486s进行操作,当我尝试在blog.js上添加查询时,它给了我一个错误。 奇怪的是它以前在graphi中工作过。

我可以在执行以下操作时重现此错误: https :

删除node_modules / gatsby-source-contentful / sec / fragments.js似乎已“修复”了该错误。

嗯,对我也一样。 我不知道这是否是正确的方法,但是还是谢谢您!

我遇到类似的错误,删除片段文件对我不起作用。 有人找到解决方案了吗?

删除片段文件应该可以解决问题。 尝试重新启动服务器。

谢谢,它是通过删除碎片文件来工作的,尽管它看起来更像是一种解决方法,而不是真正的解决方案。 有人深入研究吗?

同样的问题在这里,找不到有问题的图片有什么问题

export const mainQuery = graphql`
  query {
    contents: allContentfulContents {
      edges {
        node {
          slug
          title
          content {
            json
          }
          cover {
            fluid {
              ...GatsbyContentfulFluid_noBase64
            }
          }
          gallery {
            id
            fluid {
              src
            }
          }
        }
      }
    }
  }
`

尝试了所有有问题的片段,但没有一个起作用。

export const query = graphql`
  query {
    contentfulBlogPost {
      title
      publishedDate
      body {
        json
      }
    }
  }
`

我相信这是您内容丰富的博客中所有图像和内容的存放地。 (正文{json})

更新:更新了gatsby-source-contentful之后,似乎该错误已经消失了,至少我现在得到了我的图像。 但是以前,我得到了同样的错误消息,即该错误是Gatsby的错误消息,我应该在github上发布有关该错误的信息。

我也有同样的问题。

[email protected]
[email protected]
[email protected] (也尝试过旧版本,同样的问题

我创建了这样的gatsby项目:
gatsby new great_gatsby_bootcamp https://github.com/gatsbyjs/gatsby-starter-hello-world

已安装[email protected]和设置环境。 变量,如README.md中所述。

创建了一些简单的内容模型:
content-model

并创建了一些内容,并在运行gatsby develop得到以下错误:
output.txt

没什么特别的,几乎是默认配置。

本地主机上的React应用程序

遇到相同的问题,请尝试将gatsby-source-contentful重新安装到适用于我的2.1.19版。
npm install --save gatsby-source-contentful

我尝试重新安装,但是没有运气。 我认为它更多是错误或版本冲突而不是错误

我尝试重新安装,但是没有运气。 我认为它更多是错误或版本冲突而不是错误

我做了以下步骤:

  1. 已从gatsby-source-contentful node_modules中删除fragments.js
  2. 更新了gatsby-cli
  3. 已清除缓存npm run clean
  4. 尝试使用gatsby develop ,但出现错误(在其他论坛上,一些人设法在此步骤中修复错误)
  5. 更新了对源代码满意的npm install --save gatsby-source-contentful
  6. 已清除缓存npm run clean
  7. gatsby develop和成功-它的工作原理。

在您的内容文件中添加图像。 并在您的帖子中尝试图片。 这个固定的问题对我来说。 我不确定如何以及为什么。

对于具有相同错误的用户,我通过执行以下步骤解决了我的问题,而没有删除任何数据或降级任何程序包:

  1. 进入内容丰富的空间
  2. 点击“媒体”标签,然后将单个资产添加为虚拟图像以充当占位符
  3. 通过运行npm run developgatsby develop重新启动开发服务器

希望这也可以解决您的问题,但是如果有人可以启发我们为什么会这样,可能会有所帮助。

添加图像帮助,必须发布图像

我仍然有这个问题。 昨天,当我上载一个占位符图像时,当我继续进行同一教程时,它停止工作了。
现在,我删除了fragment.js(实际上只是注释掉了整个文件,以避免数据丢失),再次正常运行。

有同样的问题。 删除fragments.js-帮助。

删除fragments.js文件有助于消除错误。 尽管我不确定这是否是正确的解决方案。
我仍然对它的工作方式感到困惑,

有同样的问题。 在“媒体”选项卡上添加虚拟图像解决了该问题

添加图片占位符对我有用

您可以检查[email protected]解决了此问题。 @frodd可能认为他的解决方法可能与之相关。

我会对其进行测试,但是我只能在有条件的地方创建2个空格,而我现在正在使用这两个空格:/,我无法删除其中的任何一个,任何其他可以测试它的好仙子? :) 谢谢

嘿,我通过删除fragment.js的所有内容解决了这个问题,没有别的,当我删除文件时,它无效了,只是删除了内容。

删除fragments.js为我解决了这个问题,尽管这似乎不是理想的解决方案。 fragments.js文件在哪里使用?

在您的内容文件中添加图像。 并在您的帖子中尝试图片。 这个固定的问题对我来说。 我不确定如何以及为什么。

也为我工作

感谢@dreilacadin ,向Media添加图像也为我解决了该问题。

我刚完成一个全新的安装,并且此问题仍在发生。 肯定是个错误吗?

我刚完成一个全新的安装,并且此问题仍在发生。 肯定是个错误吗?

@wardpeet看起来好像没有

删除fragments.js的内容也为我解决了这个问题。

向媒体添加图像的技巧解决了该问题。 但是为什么它会这样工作?

删除为开发而修复的fragments.js。 但是,它没有针对Netlify构建对其进行修复。 但是,添加媒体确实做到了。 多么随机的“修复”。

还在“媒体”选项卡上添加了一个占位符图像,就可以解决问题。

添加了一个占位符图像并修复了我的问题。

添加占位符图像也对我有用

我也可以确认添加占位符图像,从而为我解决了此问题

添加一个(已发布!)占位符图像也对我有用。

问题在于拥有至少1种媒体资产。 可以更改代码以容忍此字段丢失吗?

我相信我所遵循的教程与上述人员相同(Andrew Mead先生撰写的“ Great Gatsby Bootcamp-Full Gatsby.js教程课程”,https://www.youtube.com/watch?v = kzWIUX3CpuI)

问题仍然存在,可以通过删除/gatsby-source-contentful/src/目录中fragment.js的内容来解决。

我没有尝试如上所述将占位符图像添加到其网站上的“内容丰富”项中。 我的项目仅是为了学习本教程,但我不希望作者总是提交图像。

我非常担心这会在将来产生无法预料的副作用,我非常犹豫是否将视频中的解决方案(Gatsby.js + Contentful)用于任何合适的项目。

有经验的开发人员可以解决此问题吗?

@ martink-rsa我没有遵循该教程。 我正在做一个真实的项目,也遇到了这个问题,我的解决方案是做占位符把戏:(

我在版本2.1.67上再次遇到此错误

即使我在内容目录中添加了虚拟图像,版本2.1.69再次发生此问题

我做了所有建议,包括删除fragement.js文件,重新安装模块以清除缓存等。但是,对我有用的是在Contentful上的媒体文件夹中添加了“虚拟”图像。肯定闻起来像Bug

来自@Kureyko评论..

  1. 从gatsby-source-contentful node_modules中删除了fragments.js
  2. 更新了gatsby-cli
  3. 清除缓存npm运行干净
  4. 尝试使用gatsby开发,但出现错误(在其他论坛上,一些人设法在此步骤中修复了错误)
  5. 更新了源内容丰富的npm安装--save gatsby-source-contentful
  6. 清除缓存npm运行干净
  7. 盖茨比不断发展并取得成功-它的运作。

我可以使用最新版本2.1.69重现此问题
我有一个名为blogPost的内容模型,如果我取消发布已发布的博客文章并执行npm run develop ,则gatsby将抛出

ERROR #11321  PLUGIN

"gatsby-node.js" threw an error while running the createPages lifecycle:

Cannot read property 'allContentfulBlogPost' of undefined



  TypeError: Cannot read property 'allContentfulBlogPost' of undefined

  - review-page.js:48 module.exports.buildReviewPages
    build/review-page.js:48:22

  - task_queues.js:85 processTicksAndRejections
    internal/process/task_queues.js:85:5

  - gatsby-node.js:7 async Object.module.exports.createPages
    gatsby-node.js:7:3

  - api-runner-node.js:235 async runAPI

我必须重新发布该帖子或发布新的博客帖子,才能使gatsby取得成功。

你好

同样的问题在这里。
即使您可以通过简单地删除Gatsby项目根目录下的.cache文件来使其工作,一旦您从Contentful中删除了任何现有的内容条目(已经与任何媒体资产相关联),重新启动Gatsby也会遇到很多错误:

image

  • 错误#11321插件

image

image

  • 错误#85901 GRAPHQL

    您的GraphQL查询中存在错误:
    未知类型“ ContentfulFixed”。
    文件:node_modules / gatsby-source-contentful / src / fragments.js:20:37

  • 错误#85923 GRAPHQL

    这是您的GraphQL查询中的错误:
    无法查询“查询”类型的字段“ allContentfulBlogPost”。

  • 错误#98123 WEBPACK

    错误无法在类型“查询” graphql / template-strings上查询字段“ allContentfulBlogPost”

并且您必须删除Gatsby项目根目录下的.cache文件,才能使其再次运行:-/

因此,当从Contenful删除任何内容时,它似乎与Gatsby有关(插件,缓存损坏... ??)!

干杯

我可以使用最新版本2.1.69重现此问题
我有一个名为blogPost的内容模型,如果我取消发布已发布的博客文章并执行npm run develop ,则gatsby将抛出

ERROR #11321  PLUGIN

"gatsby-node.js" threw an error while running the createPages lifecycle:

Cannot read property 'allContentfulBlogPost' of undefined



  TypeError: Cannot read property 'allContentfulBlogPost' of undefined

  - review-page.js:48 module.exports.buildReviewPages
    build/review-page.js:48:22

  - task_queues.js:85 processTicksAndRejections
    internal/process/task_queues.js:85:5

  - gatsby-node.js:7 async Object.module.exports.createPages
    gatsby-node.js:7:3

  - api-runner-node.js:235 async runAPI

我必须重新发布该帖子或发布新的博客帖子,才能使gatsby取得成功。

在内容丰富的媒体文件中添加映像,然后重新启动服务器。

在内容丰富的媒体文件中添加映像,然后重新启动服务器。

已经完成,因为这始终是您遇到的第一个解决方法。
实际上,我拥有与博客文章相关的媒体资产!

您确实需要通过publishig进行尝试,然后删除Contentful上的内容条目。
通常,您不必清除.cache !!,只需在满足内容的内容与Gatsby的Slugs应用程序之间的每次“不同步”时重新启动服务器即可。

感谢您的反馈。

在诊断相同问题时跑遍此问题,并认为我会与在

// Check if there are any ContentfulAsset nodes and if gatsby-image is installed. If so,
// add fragments for ContentfulAsset and gatsby-image. The fragment will cause an error
// if there's not ContentfulAsset nodes and without gatsby-image, the fragment is useless.

因为GraphQL不能很好地处理null条目,并且默认情况下gatsby-source-contentul插件查询Contentful中的所有资产,所以当找不到资产时我们会收到错误消息。

通过问题#2392的讨论,也许在gatsby-source-contentful插件中添加自定义架构可以防止这些问题。 但是与此同时,最好的“解决方案”只是将任何图像添加到Contentful> Media中,而不是删除fragments.js

iya!

这个问题已经悄无声息。 幽灵般的安静。 👻

我们遇到了很多问题,因此我们目前在闲置30天后就关闭了问题。 从上一次更新到现在已经至少20天了。
如果我们错过了此问题,或者您想使其保持打开状态,请在此处回复。 您也可以添加标签“ not stale”以保持此问题的状态!
谨在此提醒您:解决此问题或其他任何问题的最佳方法是打开请求请求。 请查看gatsby.dev/contribute ,以获取有关打开PR,分类问题和提供帮助的更多信息!

感谢您加入盖茨比社区! 💪💜

又见面了!

在此问题上发生任何事情已有30天了,因此我们友好的邻居机器人(就是我!)将关闭它。
请记住,我只是一个机器人,所以如果我错误地关闭了此问题,我就是HUMAN_EMOTION_SORRY 。 如果您还有其他需要,请随时重新打开此问题或创建一个新问题。
谨在此提醒您:解决此问题或其他任何问题的最佳方法是打开请求请求。 请查看gatsby.dev/contribute ,以获取有关打开PR,分类问题和提供帮助的更多信息!

再次感谢您加入盖茨比社区! 💪💜

添加单个媒体元素也对我有用,但是我很好奇,此错误的根本原因是Contentful的API还是gatsby-source-contentful?

我也遇到同样的错误。

编辑:添加图像资产并创建显示该图像的博客文章似乎已“解决”了问题

myName<strong i="8">@myComputer</strong>:~/www/gatsby-bootcamp$ rm -rf .cache && npm run develop

> [email protected] develop /home/myName/www/gatsby-bootcamp
> env-cmd -f env.development gatsby develop

success open and validate gatsby-configs - 0.067s
success load plugins - 2.227s
success onPreInit - 0.005s
success initialize cache - 0.014s
success copy gatsby files - 0.117s
success onPreBootstrap - 0.015s
success createSchemaCustomization - 0.489s
Starting to fetch data from Contentful
Fetching default locale
default locale is : en-US
contentTypes fetched 1
Updated entries  2
Deleted entries  0
Updated assets  0
Deleted assets  0
Fetch Contentful data: 315.783ms
success source and transform nodes - 0.600s
success building schema - 0.405s
success createPages - 0.032s
success createPagesStatefully - 0.072s
success onPreExtractQueries - 0.004s
success update schema - 0.037s

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:20:37


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:34:47


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:48:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:61:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFixed". Did you mean "ContentfulBlogPost", "ContentfulBlogPostEdge", or "ContentfulContentType"?

File: node_modules/gatsby-source-contentful/src/fragments.js:77:55


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:92:37


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:106:47


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:120:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:133:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulFluid". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:149:55


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:161:43


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:171:53


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:181:52


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:190:52


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulResolutions". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", "ContentfulBlogPostEdge", or "ContentfulBlogPostConnection"?

File: node_modules/gatsby-source-contentful/src/fragments.js:202:61


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:213:37


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:223:47


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:233:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:242:46


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Unknown type "ContentfulSizes". Did you mean "ContentfulBlogPost", "ContentfulBlogPostSys", "ContentfulContentType", or "ContentfulBlogPostEdge"?

File: node_modules/gatsby-source-contentful/src/fragments.js:254:55

failed extract queries from components - 0.695s
success write out requires - 0.037s
success write out redirect data - 0.007s
success onPostBootstrap - 0.003s
⠀
info bootstrap finished - 9.644 s
⠀
success run queries - 0.148s - 11/12 80.81/s
success Generating image thumbnails - 0.900s - 3/3 3.33/s
⠀
You can now view gatsby-starter-hello-world in the browser.
⠀
  http://localhost:8000/
⠀
View the GraphQL Playground, an in-browser IDE, to explore your site's data and schema
⠀
  http://localhost:8000/___graphql
⠀
Note that the development build is not optimized.
To create a production build, use gatsby build
⠀
success Building development bundle - 5.216s

这个问题确实不应该被关闭。 有已知原因(使用没有媒体资产的有内容空间)。 考虑到对此讨论的评论数量和评论反应,它也具有不错的影响。

有什么办法可以使它重新激活并阻止僵尸程序关闭它?

(离题:我真的不喜欢维护者运行自动关闭问题的机器人的趋势。仅仅因为某事在30天内没有发表评论,就不会使问题变得不那么真实或没有影响力。它鼓励无益的“ +1”保持问题“有效”的评论)

我同意应该还是开放的,所以我要重新开放。
有人对如何解决这个问题有任何想法吗?

https://github.com/gatsbyjs/gatsby/issues/15397的重复内容并不确定哪一个是保持打开状态的最佳线程。

我在另一个线程上添加了一些有关我最近发现的详细信息。 关于何时引入的; 还有一个位置,我们可以插入一个钩子来修复它。

我在config下面添加了gatsby-config.js:
{ resolve: "gatsby-source-filesystem", options: { name: "src", path: $ {__ dirname} / src , }, }

遇到了同样的问题,并向媒体资产添加了图片(如建议的那样),并且效果很好。 没道理,但做到了...

一样...在Contentful中添加图片后,问题就解决了。 我见过的最奇怪的东西...;-9
并且:这不仅发生在我们身上,谦卑的地球,而且您还可以在这里看到同样的情况: https :
在尝试了所有技巧之后,最终上传图像使之正常工作。 Jason Lengstorf本人也承认这绝对是“盖茨比问题”!

错误#85901 GRAPHQL

我试图从内容中获取我的博客,这给了我一个奇怪的错误。
我打开此问题的唯一原因是因为错误告诉我要这样做。

这就是错误的意思:
错误:无法获取此StaticQuery的结果。

“这可能是Gatsby中的错误,如果刷新页面无法解决问题,请在https://github.com/gatsbyjs/gatsby/issues中打开问题”

gatsby信息输出:

系统:
作业系统:Windows 10
CPU:(8)x64 Intel(R)Core(TM)i7-3632QM CPU @ 2.20GHz
二进制文件:
npm:6.9.0-C:\ Program Files \ nodejs \ npm.CMD
语言:
的Python:3.7.2
浏览器:
边缘:44.18362.1.0
npmPackages:
盖茨比:^ 2.13.51 => 2.13.51
gatsby-plugin-sass:^ 2.1.4 => 2.1.4
gatsby-plugin-sharp:^ 2.2.10 => 2.2.10
gatsby-remark-images:^ 3.1.7 => 3.1.7
gatsby备注相对图像:^ 0.2.3 => 0.2.3
gatsby-source-contentful:^ 2.1.18 => 2.1.18
gatsby源文件系统:^ 2.1.9 => 2.1.9
gatsby-transformer-remark:^ 2.6.11 => 2.6.11

错误无法拒绝

错误:系统找不到指定的路径。

  • envinfo.js:1 Function.e.exports.sync
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:4908
  • envinfo.js:1 Object.copySync
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:66886
  • envinfo.js:1 Object.t.writeSync
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:48715
  • envinfo.js:1
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:46872
  • envinfo.js:1
    [v12.0.0] / [gatsby-cli] / [envinfo] /dist/envinfo.js:1:46887
  • task_queues.js:88 processTicksAndRejections
    内部/进程/task_queues.js:88:5

您必须在内容丰富的站点中添加图像,因为在正文部分您选择了富文本框,因此添加任何图像然后重新启动服务器,这些错误将消失。

提供反馈或建议,以获得更好的解决方案,而不是此解决方案。 #happyCoding :)

{ resolve: "gatsby-source-filesystem", options: { name: "src", path: ${__dirname}/src, }, }

gatsby-config.js帮助了

我可以在执行以下操作时重现此错误: https :

删除node_modules / gatsby-source-contentful / sec / fragments.js似乎已“修复”了该错误。

为我解决了问题。 谢谢

谢谢男人,它为我工作:)

iya!

这个问题已经悄无声息。 幽灵般的安静。 👻

我们遇到了很多问题,因此我们目前在闲置30天后就关闭了问题。 从上一次更新到现在已经至少20天了。
如果我们错过了此问题,或者您想使其保持打开状态,请在此处回复。 您也可以添加标签“ not stale”以保持此问题的状态!
谨在此提醒您:解决此问题或其他任何问题的最佳方法是打开请求请求。 请查看gatsby.dev/contribute ,以获取有关打开PR,分类问题和提供帮助的更多信息!

感谢您加入盖茨比社区! 💪💜

有办法禁用它吗? ☝️

此问题影响将Gatsby与Contentful结合使用的所有人。 在我看来,在找到解决方案之前,不应关闭该解决方案(实际的解决方案,而不是变通方法)。

现在是https://github.com/gatsbyjs/gatsby/issues/15397的副本,我们希望在那里进行跟踪。

对于具有相同错误的用户,我通过执行以下步骤解决了我的问题,而没有删除任何数据或降级任何程序包:

  1. 进入内容丰富的空间
  2. 点击“媒体”标签,然后将单个资产添加为虚拟图像以充当占位符
  3. 通过运行npm run developgatsby develop重新启动开发服务器

希望这也可以解决您的问题,但是如果有人可以启发我们为什么会这样,可能会有所帮助。

将图像添加到媒体资产也对我有用。 也不知道为什么。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

mikestopcontinues picture mikestopcontinues  ·  3评论

Oppenheimer1 picture Oppenheimer1  ·  3评论

kalinchernev picture kalinchernev  ·  3评论

jimfilippou picture jimfilippou  ·  3评论

dustinhorton picture dustinhorton  ·  3评论