我无法为这个项目提供可复现的错误,因为它是一个私有项目。然而,我正在使用react-scripts 5.0.1和typescript 4.8.4。
描述错误
构建失败,报错信息为:
❯ env CI=true npm run build
> packages.dev.bloomberg.com@1.0.0 build
> react-scripts build
Creating an optimized production build...
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
The "path" argument must be of type string. Received null
The "path" argument must be of type string. Received null
The "path" argument must be of type string. Received null
The "path" argument must be of type string. Received null
尽管如此,错误信息中并没有提到路径和位置🤔
2条答案
按热度按时间waxmsbnn1#
如果构建过程中有任何位于build/static/js的文件,构建就会失败。
8iwquhpp2#
我收到了这个错误信息:
手动删除'build'文件夹,然后重新构建。
也许cra应该使用webpack 5的output.clean功能来清理构建文件夹。