Can't set styleUrls


I’m having this problem: every time I try to use styleUrls to include the scss files that ng generate create on another project I get the error

Unhandled Promise rejection: Failed to load my-css.component.scss ; Zone: <root> ;

in the component is set like this

styleUrls: ['./my-css.component.scss'],

I’ve seen many post about the same problem. I really don’t know how to solve it.
I install ionic 2 and create the project yesterday and couldn’t find out the problem.

This is my proyect structure:

I started with the “super” template and I check all the pages, none of them has this attribute added and the files are in each folder. If I add the attribute to the default pages I get the same error so I don’t think my folder structure is the problem

I saw a lot about don’t use relative path but this is the recomended way in Angular


I’m not dealing with Dropbox, but you shouldn’t need to be worrying about this. As long as the selector matches, you can just put your styles into the component.scss file in the same folder as the controller and template. Ionic will roll it all up for you.


i’ve imported some components generated with “ng generate” of the @angular/cli package and those include the reference.