Ant Design 的 Yarn 构建失败
Yarn build failed with Ant Design
我打算重新部署一个网络应用程序,所以我试图 运行 yarn 构建,但 运行 出现了这个错误。
我用的是Ant Design,之前也做过yarn eject,通过搜索google还是不行,有遇到过这个错误吗?解决它的任何提示?谢谢!
yarn run v1.22.0
$ react-app-rewired build
Creating an optimized production build...
Failed to compile.
./node_modules/antd/es/style/index.less
TypeError: this[MODULE_TYPE] is not a function
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我也遇到过同样的问题。我的问题是我混淆了 Ant Design 版本。 Ant v4.x 是最近发布的,所以我没有检查版本就使用了组件。所以,尝试使用相同版本的组件,看看它是否有效!
好的,对于可能遇到相同问题的任何人,您需要删除 react-rewire 并执行 Ant.Design 文档中显示的从 V3 到 V4 的迁移, 应该没问题
我打算重新部署一个网络应用程序,所以我试图 运行 yarn 构建,但 运行 出现了这个错误。
我用的是Ant Design,之前也做过yarn eject,通过搜索google还是不行,有遇到过这个错误吗?解决它的任何提示?谢谢!
yarn run v1.22.0
$ react-app-rewired build
Creating an optimized production build...
Failed to compile.
./node_modules/antd/es/style/index.less
TypeError: this[MODULE_TYPE] is not a function
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我也遇到过同样的问题。我的问题是我混淆了 Ant Design 版本。 Ant v4.x 是最近发布的,所以我没有检查版本就使用了组件。所以,尝试使用相同版本的组件,看看它是否有效!
好的,对于可能遇到相同问题的任何人,您需要删除 react-rewire 并执行 Ant.Design 文档中显示的从 V3 到 V4 的迁移, 应该没问题