gpt4 book ai didi

Gatsby 形象之谜

转载 作者:行者123 更新时间:2023-12-02 07:17:12 29 4
gpt4 key购买 nike

我正在使用 Gatsby + Strapi 堆栈。图片上传到 Strapi,然后通过 gatsby-source-strapi 插件下载,因为 gatsby-image 仅适用于本 map 片。

GraphQL query:
allStrapiRestaurant {
edges {
node {
logo{
childImageSharp {
fluid{
...GatsbyImageSharpFluid
}
}
publicURL
}
...

查询按预期工作,数据就在那里

{props.data.allStrapiRestaurant.edges.map((restaurant) => (
<div key={restaurant.node.id}>
<Img fluid={restaurant.node.logo.childImageSharp.fluid} />
</div>
))}

这出现了:

TypeError: Cannot read property '__reactstandin__key' of undefined

node_modules/react-hot-loader/dist/react-hot-loader.development.js:1229


1226 | return idsByType.get(type);
1227 | };
1228 | var isProxyType = function isProxyType(type) {
> 1229 | return type[PROXY_KEY];
1230 | };
1231 |
1232 | var getProxyById = function getProxyById(id) {

已经为此苦苦挣扎了两天多了。有什么想法(除了不使用 Strapi+Gatsby :)?

最佳答案

就我而言,我正在打电话

import Img from "gatsby" 

而不是

import Img from "gatsby-image" 

..这太明显了,我没有想到。我从未收到过相关错误,因为我认为 gatsby 有一个可以导入的组件,名为 Img 也许......?

关于 Gatsby 形象之谜,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57381690/

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