【发布时间】:2020-10-04 14:30:34
【问题描述】:
我正在使用 gatsby 入门博客模板,我已经成功地从内容中获取富文本并将其显示在页面上。我现在正在尝试做同样的事情,但使用降价但我收到错误“尝试获取资源时出现 NetworkError”。来自我的 graphql 查询。
我正在尝试按照此处的文档进行操作,因此首先我有一个长文本字段,用于将降价存储在内容丰富的称为“bodym”中。
我的 GraphQL 查询如下,我基本上是在尝试关注 example。我可以从内容中查询降价。
但是,当尝试将其转换为可用的 HTML 时,我收到错误:
我在控制台中得到以下信息:
ERROR
The "path" argument must be of type string. Received type undefined
Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Recei ved type undefined
- validators.js:125 validateString
internal/validators.js:125:11
- index.js:68 _callee$
[faesel-blog]/[gatsby-remark-relative-images]/index.js:68:40
- index.js:5 asyncGeneratorStep
[faesel-blog]/[gatsby-remark-relative-images]/index.js:5:103
- index.js:7 _next
[faesel-blog]/[gatsby-remark-relative-images]/index.js:7:194
- index.js:7
[faesel-blog]/[gatsby-remark-relative-images]/index.js:7:364
- new Promise
- index.js:7
[faesel-blog]/[gatsby-remark-relative-images]/index.js:7:97
- index.js:96
[faesel-blog]/[gatsby-remark-relative-images]/index.js:96:22
- new Promise
- index.js:47
[faesel-blog]/[gatsby-remark-relative-images]/index.js:47:12
- Array.map
- index.js:46 module.exports
[faesel-blog]/[gatsby-remark-relative-images]/index.js:46:22
我的代码可以在here找到。
考虑到我能够从内容中检索降价。我猜问题出在 gatsby-source-contentful 插件的某个地方。感谢您的帮助!
【问题讨论】:
标签: javascript markdown gatsby contentful