Failed to parse source map: 'webpack://antd/./components/config-provider/style/index.less' URL is not supported
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
https://github.com/sauldeleon/antd-webpack5-repro
Steps to reproduce
- clone this repo
- run
npm i
- run
npm start
- check the logs in the console
What is expected?
React start the application with no warning issues. In certain environments, warning issues are not supported and will crash the build for production environments
What is actually happening?
Webpack 5 throws errors due to loading URL for less files
Edit: as @YouWillBe said, this is due to using react-scripts 5.0.0
which uses webpack 5
Failed to parse source map: ‘webpack://antd/./components/config-provider/style/index.less’ URL is not supported Failed to parse source map: ‘webpack://antd/./components/icon/style/index.less’ URL is not supported Failed to parse source map: ‘webpack://antd/./components/locale-provider/style/index.less’ URL is not supported Failed to parse source map: ‘webpack://antd/./components/time-picker/style/index.less’ URL is not supported
Environment | Info |
---|---|
antd | 4.17.3 |
React | 17.0.2 |
System | All systems |
Browser | Chrome 96.0.4664.110 |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:35
- Comments:60 (1 by maintainers)
Top GitHub Comments
Solution :
- import 'antd/dist/antd.css
replace with+ import 'antd/dist/antd.min.css
Thanks for all your love. Please follow me on GitHub
react-script
升级到5.0.0
之后出现此问题,也就是说从14号开始,所有通过npx create-react-app
创建的项目,引入antd.css
之后都会看到这个警告