Ghost version: 3.31.5
node version: v12.18.3
Hosting: Self hosted on apache2 (working fine)
Starter template: GitHub - TryGhost/gatsby-starter-ghost: A starter template to build lightning fast websites with Ghost & Gatsby
Hi everyone,
I can’t get gatsby to connect to my Ghost instance.
Created an integration and copied the API URL and Content Key into .ghost.json.
“gatsby develop” throws the error:
ERROR #11321 PLUGIN
"gatsby-source-ghost" threw an error while running the sourceNodes lifecycle:
Cannot read property 'map' of undefined
29 |
30 | const transformCodeinjection = (posts) => {
> 31 | posts.map((post) => {
| ^
32 | const allCodeinjections = [post.codeinjection_head, post.codeinjection_foot].join('');
33 |
34 | if (!allCodeinjections) {
File: node_modules/gatsby-source-ghost/gatsby-node.js:31:11
TypeError: Cannot read property 'map' of undefined
- gatsby-node.js:31 transformCodeinjection
[my-gatsby-ghost-site]/[gatsby-source-ghost]/gatsby-node.js:31:11
- gatsby-node.js:71
[my-gatsby-ghost-site]/[gatsby-source-ghost]/gatsby-node.js:71:17
- task_queues.js:97 processTicksAndRejections
internal/process/task_queues.js:97:5
- From previous event:
- gatsby-node.js:120 createLiveGhostNodes
[my-gatsby-ghost-site]/[gatsby-source-ghost]/gatsby-node.js:120:20
- gatsby-node.js:155 Object.exports.sourceNodes
[my-gatsby-ghost-site]/[gatsby-source-ghost]/gatsby-node.js:155:12
- api-runner-node.js:330 runAPI
[my-gatsby-ghost-site]/[gatsby]/src/utils/api-runner-node.js:330:22
- api-runner-node.js:440 Promise.catch.decorateEvent.pluginName
[my-gatsby-ghost-site]/[gatsby]/src/utils/api-runner-node.js:440:17
- From previous event:
- api-runner-node.js:439
[my-gatsby-ghost-site]/[gatsby]/src/utils/api-runner-node.js:439:14
- timers.js:456 processImmediate
internal/timers.js:456:21
- From previous event:
- api-runner-node.js:431
[my-gatsby-ghost-site]/[gatsby]/src/utils/api-runner-node.js:431:13
- From previous event:
- api-runner-node.js:347 module.exports
[my-gatsby-ghost-site]/[gatsby]/src/utils/api-runner-node.js:347:3
- source-nodes.ts:94 _default
[my-gatsby-ghost-site]/[gatsby]/src/utils/source-nodes.ts:94:9
- source-nodes.ts:24 sourceNodes
[my-gatsby-ghost-site]/[gatsby]/src/services/source-nodes.ts:24:9
- interpreter.js:707 Interpreter.exec
[my-gatsby-ghost-site]/[xstate]/lib/interpreter.js:707:27
- interpreter.js:210 Interpreter.execute
[my-gatsby-ghost-site]/[xstate]/lib/interpreter.js:210:22
- interpreter.js:230 Interpreter.update
[my-gatsby-ghost-site]/[xstate]/lib/interpreter.js:230:18
- interpreter.js:131
[my-gatsby-ghost-site]/[xstate]/lib/interpreter.js:131:23
- scheduler.js:60 Scheduler.process
[my-gatsby-ghost-site]/[xstate]/lib/scheduler.js:60:13
- scheduler.js:44 Scheduler.schedule
[my-gatsby-ghost-site]/[xstate]/lib/scheduler.js:44:14
- interpreter.js:127 Interpreter.send
[my-gatsby-ghost-site]/[xstate]/lib/interpreter.js:127:29
- interpreter.js:825 actor.id
[my-gatsby-ghost-site]/[xstate]/lib/interpreter.js:825:23
Any thoughts where should I look next?
Filipe