我正在尝试将弹出的 create-react-app 迁移到 Webpack 5 并遇到此错误:
Failed to compile.
The "path" argument must be of type string. Received undefined
error Command failed with exit code 1.
我认为错误来自output.path
默认情况下 CRA 在开发中未定义,我试图将其设置为空字符串 - 或绝对路径,但无法解决。我已经能够成功地让 Webpack 5 在非 cra 应用程序上工作,而路径未定义,所以我认为它与 CRA 配置有关。我也按照本指南没有成功https://webpack.js.org/migrate/5/
代码沙箱:https ://codesandbox.io/s/musing-buck-shu04
感谢任何帮助!