gpt4 book ai didi

graphql - Gatsby 在 graphql 获取时的构建过程中给出错误 "Error: Type with name "File"does not exists"

转载 作者:行者123 更新时间:2023-12-04 15:44:52 25 4
gpt4 key购买 nike

试图建立一个 gatsby 网站,但我很难调试与 graphql 模式相关的错误(我认为)。我得到的错误是这样的:

success open and validate gatsby-configs — 0.004 s
success load plugins — 0.276 s
success onPreInit — 0.004 s
success delete html and css files from previous builds — 0.018 s
success initialize cache — 0.008 s
success copy gatsby files — 0.009 s
success onPreBootstrap — 0.005 s
Starting to fetch data from Prismic
Fetch Prismic data: 919.580ms
success source and transform nodes — 0.975 s
error Type with name "File" does not exists


Error: Type with name "File" does not exists

- TypeStorage.js:44 SchemaComposer.get
[operaloki]/[graphql-compose]/lib/TypeStorage.js:44:13

- TypeMapper.js:86 TypeMapper.get
[operaloki]/[graphql-compose]/lib/TypeMapper.js:86:44

- TypeMapper.js:608 TypeMapper.typeFromAST
[operaloki]/[graphql-compose]/lib/TypeMapper.js:608:17

- TypeMapper.js:105 TypeMapper.getWrapped
[operaloki]/[graphql-compose]/lib/TypeMapper.js:105:17

- TypeMapper.js:272 TypeMapper.convertOutputFieldConfig
[operaloki]/[graphql-compose]/lib/TypeMapper.js:272:114

- configAsThunk.js:19 resolveOutputConfigAsThunk
[operaloki]/[graphql-compose]/lib/utils/configAsThunk.js:19:41

- configAsThunk.js:37 Object.keys.forEach.name
[operaloki]/[graphql-compose]/lib/utils/configAsThunk.js:37:22

- Array.forEach

- configAsThunk.js:36 resolveOutputConfigMapAsThunk
[operaloki]/[graphql-compose]/lib/utils/configAsThunk.js:36:27

- ObjectTypeComposer.js:147 GraphQLObjectType.gqType._fields
[operaloki]/[graphql-compose]/lib/ObjectTypeComposer.js:147:114

- Array.reduce

- SchemaComposer.js:130 SchemaComposer.buildSchema
[operaloki]/[graphql-compose]/lib/SchemaComposer.js:130:12

- schema.js:500
[operaloki]/[gatsby]/dist/schema/schema.js:500:47

我不知道 File 是什么类型,而且我在我的文件中找不到这个词的任何出现。

有人知道吗?

最佳答案

gatsby-source-prismic-graphql 插件的最近更新中,所有者插入了对 gatsby-image 的支持。从那时起,他更新了您应该开始使用的示例,但对于现有项目,您需要添加这三个插件以确保一切按预期工作:

  • gatsby-source-filesystem
  • gatsby-transformer-sharp
  • gatsby-plugin-sharp

希望对您有所帮助。

关于graphql - Gatsby 在 graphql 获取时的构建过程中给出错误 "Error: Type with name "File"does not exists",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56304307/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com