CSS 错误源映射信息在 URL() 声明中不可用(找到孤立 CR,尝试 removeCR 选项) [英] CSS error source-map information is not available at URL() declaration (found orphan CR, try removeCR option)
问题描述
我在项目中执行 NPM start 时遇到问题.我收到此错误消息:
I am having a problem when I execute NPM start in my project. I get this error message:
./src/assets/base.scss (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/react-scripts/node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-5-4!./src/assets/base.scss)
Error: resolve-url-loader: CSS error
source-map information is not available at url() declaration (found orphan CR, try removeCR option)
推荐答案
这个问题可能有多种原因,我将给出3种可能的解决方案,请全部尝试
There can be multiple reasons for this problem, I will give 3 possible solutions please try all of them
- 尝试更新
node_modules\resolve-url-loader
中存在的index.js
所以在这里在var 选项
下
- try updating the
index.js
present innode_modules\resolve-url-loader
so here under thevar options
var options = Object.assign({
sourceMap: loader.sourceMap,
engine: 'postcss',
silent: false,
absolute: false,
keepQuery: false,
**
removeCR: false-- > make this "true" ** ,
root: false,
debug: false,
join: joinFn.defaultJoin
}
然后重新启动您的应用
下一个解决方案与上面的解决方案相同,将行尾顺序改为LF查看下面的截图以了解它是如何在 VS Code 中完成的
检查您的 CSS 文件,方法是将它们一一注释并运行您的代码以查找存在错误的文件.检查所有导入语句以及 CSS 文件中的网络链接.
Check Your CSS files by commenting them one by one and running your code to find the file with the bug. Check all import statements and also the web links in your CSS file.
附言这是我的第一个答案,所以请放轻松:p有关我所写内容的更多参考,您还可以访问此链接 ->更多详情你也可以参考这个链接
P.S. This is my first answer so please go easy on me :p for more reference to what I wrote you can also visit this link -> For more details you can also refer this link
这篇关于CSS 错误源映射信息在 URL() 声明中不可用(找到孤立 CR,尝试 removeCR 选项)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!