Netlify 上的 Gatsby 构建错误 - page-data.json 分页失败 “/”
当我尝试在 netlify 上构建 gatsby 应用程序时,我遇到了由名为“react-water-wave”的第 3 方模块生成的错误。 这是错误
我已经在 gatsby-node.js 上实现了一个空加载器:
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
if (stage === "build-html" || stage === "develop-html") {
actions.setWebpackConfig({
module: {
rules: [
{
test: /react-water-wave/,
use: loaders.null(),
},
],
},
})
}
}
这就是 gatsby-plugin-emotion 在 gatsby-config.js 上的编码方式
plugins: [
{resolve: `gatsby-plugin-emotion`,
options: {
// Accepts the following options, all of which are defined by `@emotion/babel-plugin` plugin.
// The values for each key in this example are the defaults the plugin uses.
sourceMap: true,
autoLabel: "always",
labelFormat: `[local]`,
cssPropOptimization: true,
}
}]
when I try to build a gatsby app on netlify, I'm having this error that is generated by a 3rd party module called react-water-wave.
This is the error
I've already implemented a null loader on gatsby-node.js:
exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
if (stage === "build-html" || stage === "develop-html") {
actions.setWebpackConfig({
module: {
rules: [
{
test: /react-water-wave/,
use: loaders.null(),
},
],
},
})
}
}
This is how is coded the gatsby-plugin-emotion on gatsby-config.js
plugins: [
{resolve: `gatsby-plugin-emotion`,
options: {
// Accepts the following options, all of which are defined by `@emotion/babel-plugin` plugin.
// The values for each key in this example are the defaults the plugin uses.
sourceMap: true,
autoLabel: "always",
labelFormat: `[local]`,
cssPropOptimization: true,
}
}]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
react-water-wave
似乎已停止使用,最后一次提交是在 3 年前,据报道,在 SSR 和 React 版本期间存在一些不兼容问题,这是从 https://github.com/homerchen19/react-water-wave/issues/14 和 https://github.com/homerchen19/react-water-wave/issues/27。它似乎不适用于高于 17 的 React 版本。
也就是说,尝试使用 React 核心版本(这可能会导致其他错误)(这可能会导致其他错误)或尝试寻找其他替代方案。
react-water-wave
seems to be discontinued, the last commit is from 3 years ago and it has been reported with some incompatibilities during SSR and React version as it is inferred from https://github.com/homerchen19/react-water-wave/issues/14 and https://github.com/homerchen19/react-water-wave/issues/27.It seems to don't work with React versions greater than 17.
That said, try playing (downgrading) with React-core versions (which can potentially lead to other errors) or try finding another alternative.