ionic-framework: sass error
Hi, I installed ionic2 cli npm install -g ionic@beta
and created a new project ionic start cutePuppyPics --v2
, following the official website.
then ionic serve
. I got
Running 'serve:before' gulp task before serve
[23:07:29] Starting 'clean'...
[23:07:29] Finished 'clean' after 9.51 ms
[23:07:29] Starting 'watch'...
[23:07:29] Starting 'sass'...
[23:07:29] Starting 'html'...
[23:07:29] Starting 'fonts'...
[23:07:29] Starting 'scripts'...
[23:07:29] Finished 'scripts' after 71 ms
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";
--^
And the page opens in the browser without css… if I comment the line 33 (the if
), it runs ok…
Your system information: Cordova CLI: 5.3.1 Ionic Framework Version: 2.0.0-beta.4 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 OS: Node Version: v4.0.0
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 23 (6 by maintainers)
Commits related to this issue
- updating packages due to error https://github.com/driftyco/ionic/issues/6258#issuecomment-212728777 — committed to doorty/Ionic-2-Weather by deleted user 8 years ago
Hey everyone, sorry you’re running into this. Could you run the following commands:
and then run
ionic serve
again and let me know if that fixes the error?https://medium.com/@xzyfer/why-node-sass-broke-your-code-and-semver-1b3e409c57b9
The Sass causing the error has been fixed in beta.6, so just updating ionic-angular should resolve it.
If you need to stay on a previous version, you’ll need to downgrade to node-sass 3.4.1 I believe. If you’re using npm3 you can install it from your project root and it should work fine, otherwise for npm 2 you would need to navigate to node_modules/ionic-gulp-sass-build/node_modules/gulp-sass/ and install it there. On Thu, Apr 21, 2016 at 7:37 PM Aaron K Saunders notifications@github.com wrote:
@DILEEP-YADAV Sure, this is just a workaround. I bet @brandyscarney and her team are taking care of this issue…