【问题标题】:Minified React Error #321 with Docusaurus v2使用 Docusaurus v2 缩小 React 错误 #321
【发布时间】:2021-08-20 21:12:46
【问题描述】:

我正在尝试部署 Docusaurus v2,但我不断收到此错误:

Creating an optimized production build...

√ Client
  Compiled successfully in 18.44s

× Server
  Compiled with some errors in 20.74s
Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
...
...
...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! website@0.0.0 deploy: `docusaurus deploy`
npm ERR! Exit status 1

我在一个团队中工作,每个人都在同一个 repo 上工作,deploy 似乎适用于大多数人。错误解码器链接表明它可能是:

  1. React 和 React-dom 的版本不匹配。
  2. 打破挂钩规则。
  3. 在同一个应用程序中有多个 React 副本。

我尝试更新所有内容,包括 React 和 react-dom。

我看不出它怎么可能是 2 或 3,因为它适用于大多数人。一切都在本地运行良好。有什么建议可以尝试部署吗?

【问题讨论】:

    标签: node.js reactjs npm docusaurus


    【解决方案1】:

    我遇到了同样的问题 - 我修改了 index.js 中的默认 const {siteConfig} = useDocusaurusContext();,将其移出函数。

    一旦我把它移回函数中就可以工作了。

    (可能对你没有帮助,因为你说它对某些人有用,但是嘿,对我有用!)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-14
      • 2023-02-24
      • 2020-05-11
      • 2022-11-03
      • 2021-09-30
      • 2020-08-29
      • 2020-09-13
      • 1970-01-01
      相关资源
      最近更新 更多