angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Error occur after reinstall node modules

Open duynb opened this issue 9 years ago • 3 comments

My layout component is like this:

` @Component({

selector: 'admin-main-layout',
templateUrl: './main-layout.component.html', styleUrls: [ 'assets/admin/css/bootstrap.min.css', 'assets/admin/css/font-awesome.min.css', ... ], encapsulation: ViewEncapsulation.None }) `

That work fine untill .. Recently when I delete the node_modules folder and reinstall using npm install

The error occur when I run ng server :

`

ERROR in ./src/app/admin/main-layout.component.ts Module not found: Error: Can't resolve './assets/admin/css/bootstrap.min.css' in ... ... @ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js @ ./~/@angular/core/src/linker.js @ ./~/@angular/core/src/core.js @ ./~/@angular/core/index.js @ ./src/main.ts @ multi main `

Is there any new update in core that couse the problem? Thank you.

duynb avatar Jan 18 '17 07:01 duynb

Style urls should be relative, and it looks like you're using an absolute path. Try making the url relative to the component.

filipesilva avatar Jan 18 '17 09:01 filipesilva

Thanks :) Relative path solve the problem.

duynb avatar Jan 19 '17 09:01 duynb

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.