简体   繁体   English

角ag-grid(使用值代替错误的实例)postcss-url…无法读取文件

[英]Angular ag-grid (Emitted value instead of an instance of Error) postcss-url … Can't read file

I've recently updated my modules from my angular 5 project and after opening it with angular-cli I'm getting following warning: 我最近从我的angular 5项目更新了我的模块,并用angular-cli打开它后,我得到以下警告:

WARNING in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss (Emitted value instead of an instance of Error) postcss-url: C:\\workspace\\default...\\src\\styles.scss:4673:7: Can't read file 'C:\\workspace\\default...\\src\\~ag-grid\\src\\styles\\material-icons\\left.svg', ignoring NonErrorEmittedError: (Emitted value instead of an instance of Error) postcss-url: C:\\workspace\\default...\\src\\styles.scss:4673:7: Can't read file 'C:\\workspace\\default...\\src\\~ag-grid\\src\\styles\\material-icons\\left.svg', ignoring 警告:./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!../node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}! ./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths::[]}!../src/styles.scss(发出的值,而不是错误)postcss-url:C:\\ workspace \\ default ... \\ src \\ styles.scss:4673:7:无法读取文件'C:\\ workspace \\ default ... \\ src \\〜ag-grid \\ src \\ styles \\ material-icons \\ left.svg',忽略NonErrorEmittedError :(使用值代替Error实例)postcss网址:C:\\ workspace \\ default ... \\ src \\ styles.scss:4673:7:可以't读取文件'C:\\ workspace \\ default ... \\ src \\〜ag-grid \\ src \\ styles \\ material-icons \\ left.svg',忽略

I've also tried to roll back to the older versions of the modules but the warning is still there. 我也尝试回滚到模块的旧版本,但警告仍然存在。 Does anybody know how to remove the warning? 有人知道如何删除警告吗? The project is working fine but those warnings are anoying. 该项目运行良好,但这些警告令人讨厌。

Don't use absolute path, instead use relative path. 不要使用绝对路径,而要使用相对路径。 Check your code, somewhere you are trying to call "left.svg" which is not available at "C:\\workspace\\default...\\src\\~ag-grid\\src\\styles\\material-icons\\left.svg". 检查您试图调用“ left.svg”的代码,该代码在“ C:\\ workspace \\ default ... \\ src \\〜ag-grid \\ src \\ styles \\ material-icons \\ left.svg”不可用。

Whereever you are calling "left.svg" put a slash (/) in front. 无论您叫“ left.svg”在哪里,都在前面加一个斜杠(/)。 Example: 例:

example:'/assets/images/logo.png' where assets is located in the root under src folder 示例:“ / assets / images / logo.png”,其中资产位于src文件夹下的根目录中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM