昨天,在许多个月中,通过Contentful添加博客帖子触发了Netlify的构建钩子时,一切工作正常。今天,新的Blogg帖子通过Netlify添加和构建钩子不起作用。当在本地运行gatsby开发或gatsby构建时,一切正常,新的博客文章就在那里。
这是Netlify上的错误:运行createPages生命周期时,错误“ gatsby-node.js”引发了错误:7:19:16 PM:减速器可能不会调度动作:
不确定如何确认缓存已清除以及下一步如何尝试。有任何想法吗?
创建页面:
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,
},
});
});
})
);
});
};
我设法解决了这个问题。正如我刚刚测试过的,在不相信它会有所帮助的情况下删除了yarn.lock文件。但是在推动删除Delete yarn.lock提交以掌握之后,它触发了我的构建,而没有yarn.lock的该构建Git回购迫使Netlify依赖于Installing NPM modules
构建,而忽略了Yarn。
这有助于:https : //community.netlify.com/t/support-guide-debugging-netlify-site-builds/142
关于缓存的神秘事物。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句