Gatsby-source-ghost plugin not functioning correctly

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: '',
    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:

“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

  • gatsby-node.js:71

  • task_queues.js:89 processTicksAndRejections

  • From previous event:

  • gatsby-node.js:120 createLiveGhostNodes

  • gatsby-node.js:155 Object.exports.sourceNodes

  • api-runner-node.js:234 runAPI

  • api-runner-node.js:347 Promise.catch.decorateEvent.pluginName

  • api-runner-node.js:346

  • timers.js:439 processImmediate

Any help appreciated!

Hey @Oli_C

Your Ghost instance is probably not upgraded to 3.0 yet, but the source plugin defaults to 3.0, see here:

You will either need to upgrade your Ghost install, or pass in the version property, set to v2.

Let me know if that solved the issue.

Thanks Aileen, I tried changing the version to v2, but it also fails, so I have left an issue on the Github page.