I’ve been building brochure sites with WordPress as a backend and Gatsby as the frontend for years – however i’ve not done one for a few months.
I came to build a new one last night for a client, and I’m getting errors that i’ve never seen before referencing my ACF fields.
No amount of googling has helped, and i’m a bit stuck and unsure what to do.
Here’s my gatsby-node.js
file, which i’ve basically copied from an old project that worked perfectly:
const path = require('path')
// const { urlMap } = require('./src/utils/urls')
exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions
const nodes = await graphql(`
{
allWpPage {
nodes {
id
title
pageBuilderModules {
fieldGroupName
pageBuilderModules {
fieldGroupName
... on PageBuilderModulesPageBuilderModulesPageTitleLayout {
fieldGroupName
title
}
}
}
}
}
}
`)
if (nodes.errors) {
console.log('houston, we got a problem');
throw nodes.errors;
}
nodes.data.allWpPage.nodes.forEach((page) => {
// Creates pages
console.log(`Creating ${page.title} page.`)
// createPage({
// path: page.uri,
// component: path.resolve(__dirname, 'src/templates/page.js'),
// context: { ...page },
// })
})
}
And my ACF fields are pretty simple:
Any help would be greatly appreciated!!!