Yesterday and during many months everything worked fine when adding a blogpost via Contentful that triggered a build hook on Netlify. Today a new Blogg post add and build hook via Netlify does not work. When locally running gatsby develop or gatsby build everything works and the new blogpost is there.
Here is the error on Netlify: error "gatsby-node.js" threw an error while running the createPages lifecycle: 7:19:16 PM: Reducers may not dispatch actions:
- Have tried "clearing cache and deploy site" button via Netlify
- Have tried gatsby clean, npm install and pushing a triggered deploy also via GitHub
Unsure how to confirm cache is cleaned and what to try next. Any ideas?
Create pages:
const Promise = require('bluebird');
const path = require('path');
exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions;
const typeDefs = `
type ContentfulHeroBanner implements Node {
headerLeft: String
headerCenter: String
headerRight: String
}
`;
createTypes(typeDefs);
};
exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions;
return new Promise((resolve, reject) => {
const blogPost = path.resolve('./src/templates/blog-post.js');
resolve(
graphql(
`
{
allContentfulBlogPost {
edges {
node {
title
slug
}
}
}
}
`
).then(result => {
if (result.errors) {
console.log(result.errors);
reject(result.errors);
}
const posts = result.data.allContentfulBlogPost.edges;
posts.forEach((post, index) => {
createPage({
path: `/blog/${post.node.slug}/`,
component: blogPost,
context: {
slug: post.node.slug,
},
});
});
})
);
});
};