我正在使用 CodeSandbox 制作 Gatsby 应用程序,并且我正在尝试将 Prismic 用于后端。我确定它设置得很好,并安装gatsby-source-prismic
到我的项目中。但是,当我将它添加到我的配置文件并重新启动项目时,它会抛出一个错误,提示“无效的插件选项”。这是我的插件文件中的内容:
{
resolve: `gatsby-source-prismic`,
options: {
repositoryName: `firstprism`,
accessToken: `XXX`
},
},
这是堆栈:
ERROR
gatsby-source-prismic - 无效的插件选项
错误
需要一个类型record<string,object>
为schemas
但已接收的值undefined
。
错误:
index.cjs:650 新的 StructError [沙盒]/[superstruct]/lib/index.cjs:650:19
index.cjs:707 Function.Struct.assert [沙盒]/[superstruct]/lib/index.cjs:707:13
index.cjs:679 结构 [沙盒]/[超结构]/lib/index.cjs:679:19
gatsby-node.js:74 validatePluginOptions [沙盒]/[gatsby-source-prismic]/dist/gatsby-node.js:74:50
gatsby-node.js:1042 [沙盒]/[gatsby-source-prismic]/dist/gatsby-node.js:1042:25
生成器.next
gatsby-node.js:52 [沙盒]/[gatsby-source-prismic]/dist/gatsby-node.js:52:71
新的承诺
gatsby-node.js:48 __awaiter [沙盒]/[gatsby-source-prismic]/dist/gatsby-node.js:48:12
gatsby-node.js:1029 Object.sourceNodes [沙盒]/[gatsby-source-prismic]/dist/gatsby-node.js:1029:55
api-runner-node.js:256 runAPI [沙盒]/[gatsby]/dist/utils/api-runner-node.js:256:37
api-runner-node.js:375 解析 [沙盒]/[gatsby]/dist/utils/api-runner-node.js:375:15
debuggability.js:384 Promise._execute [沙盒]/[bluebird]/js/release/debuggability.js:384:9
promise.js:518 Promise._resolveFromExecutor [沙盒]/[bluebird]/js/release/promise.js:518:18
promise.js:103 新的 Promise [沙盒]/[bluebird]/js/release/promise.js:103:10
api-runner-node.js:374 Promise.mapSeries.plugin [沙盒]/[gatsby]/dist/utils/api-runner-node.js:374:12