I have been trying to use the “gatsby-source-ghost” plugin for Gatsby to display posts from the blog, but I am seeing an error as soon as I add the setup to my gatsby-config.js file. Just to clarify, I added per instructions, like this:
{
resolve: 'gatsby-source-ghost',
options: {
apiUrl: 'http://mydomain.com/ghost',
contentApiKey: 'xxx',
},
},
I have posts live and see lots of posts in the JSON response when I manually hit the v2 API, so not sure why I get an error here…
I am using version: 4.01 (latest) and the error details are:
ERROR #11321 PLUGIN
“gatsby-source-ghost” threw an error while running the sourceNodes lifecycle:
Cannot read property ‘map’ of undefined
TypeError: Cannot read property ‘map’ of undefined
gatsby-node.js:31 transformCodeinjection
[landing-page]/[gatsby-source-ghost]/gatsby-node.js:31:11gatsby-node.js:71
[landing-page]/[gatsby-source-ghost]/gatsby-node.js:71:17task_queues.js:89 processTicksAndRejections
internal/process/task_queues.js:89:5From previous event:
gatsby-node.js:120 createLiveGhostNodes
[landing-page]/[gatsby-source-ghost]/gatsby-node.js:120:20gatsby-node.js:155 Object.exports.sourceNodes
[landing-page]/[gatsby-source-ghost]/gatsby-node.js:155:12api-runner-node.js:234 runAPI
[landing-page]/[gatsby]/dist/utils/api-runner-node.js:234:37api-runner-node.js:347 Promise.catch.decorateEvent.pluginName
[landing-page]/[gatsby]/dist/utils/api-runner-node.js:347:15api-runner-node.js:346
[landing-page]/[gatsby]/dist/utils/api-runner-node.js:346:12timers.js:439 processImmediate
internal/timers.js:439:21
Any help appreciated!