I’m a long-time Ghost fan that’s recently made the jump to building themes with Gatsby. I’ve managed to build a few themes thus far, but something odd happens when attempting to source content from my largest blog, hackersandslackers.
When pointing a theme to consume data from this blog, running gatsby develop
or gatsby build
results in the following error:
"gatsby-source-ghost" threw an error while running the sourceNodes lifecycle:
Cannot read property 'concat' of null
TypeError: Cannot read property 'concat' of null
- gatsby-node.js:35 posts.map
[stockholm]/[gatsby-source-ghost]/gatsby-node.js:35:59
- Array.map
- gatsby-node.js:31 transformCodeinjection
[stockholm]/[gatsby-source-ghost]/gatsby-node.js:31:11
- gatsby-node.js:72 api.posts.browse.then
[stockholm]/[gatsby-source-ghost]/gatsby-node.js:72:17
- next_tick.js:68 process._tickCallback
internal/process/next_tick.js:68:7
This error actually occurs on all themes, including gatsby-starter-ghost, so I’m fairly certain this error is occurring as a result of something in my data which Gatsby considers missing or corrupted. Gatsby actually manages to build despite the failures, no posts are displayed. What’s even more interesting is that the theme seems to recognize that the posts exist somehow as pagination remains intact despite an apparent lack of posts:
If this helps at all, the only mention of concat
I’m seeing in gatsy-plugin-ghost-manifest is on line 57 of gatsby-ssr.js:
headComponents = [].concat(headComponents, iconLinkTags);
For what it’s worth, it looks like somebody else had this issue a while back as well: TypeError: Cannot read property ‘concat’ of null
What I’m Running
- Ghost admin version: 2.30.2
- Gatsby CLI version: 2.7.47
- Gatsby version: 2.15.9
- Node version: v10.16.3
- MariaDB version: 5.7
Let me know if there’s anything else I could provide to help solve this issue.