gatsby-source-contentful无法访问您的内容空间 [英] Accessing your Contentful space failed with gatsby-source-contentful

查看:112
本文介绍了gatsby-source-contentful无法访问您的内容空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

gatsby: 2.20.8
gatsbh-source-contentful: 2.2.5

我已经验证了我的spaceIdaccessToken是正确的,并且已经验证了这些键可以访问我的Contentful development环境.我已经尝试过:

I've verified my spaceId and accessToken are correct, and I've verified that these keys have access to my Contentful development environment. I've tried:

  • 启用GATSBY_CONTENTFUL_OFFLINE
  • 删除.cache目录
  • 删除node_modules
  • environment设置为母版"并将其完全删除
  • 将环境变量包装在模板文字中(建议在旧的github问题上使用)
  • Enabling GATSBY_CONTENTFUL_OFFLINE
  • Deleting the .cache directory
  • Deleting node_modules
  • Setting environment to "master" and removing it completely
  • Wrapping the env vars in template literals (suggested on an old github issue)

我不断收到此错误.有什么想法吗?

I keep getting this error. Any ideas?

ERROR 

Accessing your Contentful space failed.
Try setting GATSBY_CONTENTFUL_OFFLINE=true to see if we can serve from cache.

Used options:
spaceId: "*********z1u"
accessToken: "*****************************************vMI'"
environment: "development"
host (default value): "cdn.contentful.com"
downloadLocal (default value): false
localeFilter (default value): [Function]
forceFullSync (default value): false
pageLimit (default value): 100
useNameForId (default value): true

这是我来自gatsby-config.js

{
  resolve: `gatsby-source-contentful`,
  options: {
    spaceId: process.env.CONTENTFUL_SPACE_ID,
    accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
    environment: process.env.CONTENTFUL_ENVIRONMENT,
  },
},

推荐答案

在将一个空间导入到另一个空间后,出现了类似的问题. 我删除了演示API密钥(我曾尝试使用过)并创建了一个新密钥. 在那之后工作

Had a similar issue, after importing one space to another. I deleted the demo API key (which i had tried to use) and created a new one. Worked after that

这篇关于gatsby-source-contentful无法访问您的内容空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆