简体   繁体   中英

Running into “Can't Resolve” Error After Migrating from Beta 31 to RC 1 in Angular-CLI App

In migrating from beta 31 to rc.1 in my Angular-CLI app, I am now getting some compilation errors, as it pertains to some of my custom icons/images. This is the error I'm getting:

ERROR in ./src/app/ui/nav-menu.component.css Module not found: Error: Can't resolve './app/img/home-icon.svg' in '/Users/mk/Documents/abc/src/app/ui' @ ./src/app/ui/nav-menu.component.css 6:3777-3813 @ ./src/app/ui/nav-menu.component.ts @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client? http://localhost:4200 ./src/main.ts

Specifically, what does it indicate when the error states "can't resolve"? Does that imply the item isn't where the app is looking for it? Or something else?

如果使用的是angular-cli,则将静态文件(例如imagesfonts等)放置在assets文件夹中,并按如下所示在您的HTML文件中引用它们

<img src="assets/sample.jpg" alt="some alt">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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