Serve angular error


#1

Hey everyone,
i just started with Ionic 2 and i am getting error when i try to serve project.

error looks like this:

node_modules\ionic-angular\components.core.scss
Error: Import directives may not be used within control directives or mixins.
        on line 34 of node_modules/ionic-angular/components.core.scss
>>   @import "fonts/ionicons";
   --^

when browser opens everything looks ugly, looks like there is no angular at all.

any suggestions?


#2

I had the same problem when I deleted a component, but left it inside app.core.scss.
Do you have any .scss import that does not exist?


#3

That error seems to steam from the ionic core scss. The @Import font/ionicioncs is sitting in a @if statement. If you essentially take it out your scss will compile. Apparently the sass compiler hits that I line and stop, which doesn’t produce and CSS in the build folder.


#4

Facing the same issue. any solution for this guys?


#5

This is because of the following issue (there’s also a workaround in the comments):


#6

Thank you for helping! Now its working perfectly!