无法部署Gatsby + Netlify + DatoCMS

时间:2019-09-18 15:03:19

标签: gatsby netlify

我当前正在将这个入门工具https://github.com/brohlson/gatsby-datocms-starter用于我正在创建的网站。我想将其连接到Netlify进行自动部署,所以我:

去Netlify并添加了我的Github存储库 在DatoCMS上添加了webhook

这是我在部署过程中遇到的错误:

4:48:29 PM: error #11321 PLUGIN 401 INVALID_SITE (details: {})
4:48:29 PM: "gatsby-source-datocms" threw an error while running the sourceNodes lifecycle:
4:48:29 PM: 401 INVALID_SITE (details: {})
4:48:29 PM: See our docs page for more info on this error: https://gatsby.dev/issue-how-to
4:48:29 PM: 
4:48:29 PM:   ApiException: 401 INVALID_SITE (details: {})
4:48:29 PM:   
4:48:29 PM:   - Client.js:120 
4:48:29 PM:     [repo]/[datocms-client]/lib/Client.js:120:33
4:48:29 PM:   
4:48:29 PM:   - next_tick.js:68 process._tickCallback
4:48:29 PM:     internal/process/next_tick.js:68:7
4:48:29 PM:   
4:48:29 PM: 
4:48:29 PM: Function Dir: /opt/build/repo/functions

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我没有像上面提到的那样丢掉令牌。我已经按照文档中的说明添加了DATO_CMS_TOKEN,但我意识到我的.env配置文件已设置为DATO_CMS_KEY,因此它从未加载。

始终注意env变量! (这提醒我)

相关问题