Netlify 上的 Gatsby 构建错误 - page-data.json 分页失败 “/”

发布于 2025-01-13 19:01:16 字数 1052 浏览 0 评论 0原文

当我尝试在 netlify 上构建 gatsby 应用程序时,我遇到了由名为“react-water-wave”的第 3 方模块生成的错误。 这是错误

Netlify Deploy log

我已经在 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

Netlify Deploy log

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最后的乘客 2025-01-20 19:01:16

react-water-wave 似乎已停止使用,最后一次提交是在 3 年前,据报道,在 SSR 和 React 版本期间存在一些不兼容问题,这是从 https://github.com/homerchen19/react-water-wave/issues/14https://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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文