【问题标题】:Failed to minify the code ./node_modules/@material-ui/core/es/styles/createMuiTheme.js无法缩小代码 ./node_modules/@material-ui/core/es/styles/createMuiTheme.js
【发布时间】:2018-11-08 12:40:06
【问题描述】:

嘿,我正在使用最新版本的材料 UI,当我尝试创建构建(react-scripts 构建)时遇到问题。 这是我得到的错误:

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file: 

 	./node_modules/@material-ui/core/es/styles/createMuiTheme.js:17 

我没有为我的问题找到任何解决方案。我正在使用 createMuiTheme 来覆盖某些组件。 非常感谢你。

【问题讨论】:

  • 你能告诉我们你覆盖样式的组件和你导入createMuiTheme的方式吗?

标签: material-ui


【解决方案1】:

这是 material-ui 的常见错误,当您在路径中导入带有 /es 的组件时会发生此错误。

如果您在某个时候导入了createMuiTheme,请搜索您的代码。您很可能从 @material-ui/core/es/styles... 导入它,而是以这种方式导入它:

import { createMuiTheme } from '@material-ui/core/styles';

【讨论】:

    猜你喜欢
    • 2021-10-24
    • 2020-02-14
    • 1970-01-01
    • 2020-05-04
    • 2023-03-03
    • 1970-01-01
    • 2020-02-04
    • 2021-07-17
    • 1970-01-01
    相关资源
    最近更新 更多