New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.scss not compiling .css automatically anymore after update #2859
Comments
@1BJK903 What's your Mine is this and it works for me: gulp.task('sass', function(done) {
gulp.src('./scss/ionic.app.scss')
.pipe(sass())
.on('error', sass.logError)
.pipe(gulp.dest('./www/css/'))
.pipe(cleanCss({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest('./www/css/'))
.on('end', done);
}); |
@dwieeb, thanks for your response. This is how mine looks like:
It worked before, before I updated the libraries / dependencies. Can you see what is wrong here? I just want it to work as before. I was changing the .scss file and it directly changed the .css files. Right now, that part doesn't work and I have no clue why. PS: changing it to your code doesn't work either. Just changes the .scss file, but the .css files are untouched. |
@1BJK903 What libraries/dependencies did you update? I am using the latest |
Good question @dwieeb. I don't know for sure, but certainly things like npm, gulp, gulp-sass, node-sass, ionic, Angular and so on. This is the list I am using:
|
@dwieeb: does this have to do something with: #1989 It seems so. Would it work again if I'd go back to Ionic CLI 2? I think I updated Ionic to CLI 3 and that seems to have caused the problem. Or do you think it's something else? Otherwise I am suspecting this might be the problem:
Or doesn't this one matter? |
@1BJK903 No, that issue is very old and was fixed. If you updated everything all at once, then it could be any number of things. I find it hard to believe this is the CLI's fault if I also see a lot of things that could be cleaned up in your |
@dwieeb: I do think that's the problem, as it was working before I updated it all... I remember using Ionic CLI 2. Beside that, Before, it was just doing it all automatically. What else can I clean up, btw? |
@1BJK903 I don't know what you're saying. How could it run for you automatically? What would run it? When developing Ionic Apps, Also, why would As for your All of these can be removed (the CLI warns you about this):
This is ancient and can be removed:
You don't need the CLI installed locally, either. What is You have the Ionic Angular 3 installed, but you're using Ionic 1, right?:
|
Hi there @dwieeb, Thank you for your response. Well, it was working just "automatically", without me having to use
I only had to use ionic serve when I was using ionic livereload for editing it in-browser, but for xCode, I could just change my .scss code and notice it fetching the .css automatically without the need of Thank you for the information regarding the dependencies. I am missing these things in documentations and so on. There are so many documents and Stackoverflow questions about the simplest questions, just because the documentation is lacking. So, thank you for your help, it gives me insight in how to deal with them. PS: yes, I meant that .css has to change. I am editing .scss and it should change .css indeed. So what you are saying is that what I am asking for, shouldn't be possible at all? In that case, this can be closed, but I am wondering how it was working for me then. Weird shizzle! |
I think I finally understand your issue.
But actually, this is incorrect. It should build the sass! Okay, thank you for being patient with me. I will fix this up. |
Hey i just wanted to chime in that I had the same problem. Thanks for bringing this to attention. Making changes to scss is very time consuming right now. |
I submitted this ticket about it with support. #6801: Hello there, I am working on an Ionic project and when I make any changes to scss files (even valid changes), the app essentially fails to reload giving the error ‘Cannot read property of Null’. I can refresh the app manually, but from then on every time I make changes to files in the project live reload fails with the same error. This forces me to use ionic serve for each scss change I make which makes development slow. ---- End of Ticket I should note that my project is Ionic3. I'm developing on windows 10. |
@1BJK903 @moscoso I just committed a fix for this issue. EDIT: 3.18.0 has this fix: https://github.com/ionic-team/ionic-cli/blob/master/CHANGELOG.md#3180-2017-11-09
|
@dwieeb: thank you! Would it be a problem if I'd update it with the NPM version I have? I mean, I am using Ionic 1 and don't want to update it if it's going to break it all. I am missing guidance from Ionic regarding the compatible versions we can use. Beside that, I have no clue what ionic@canary is, for example. Could you explain? |
@1BJK903 My goal with the Ionic CLI is to support all versions of Ionic Framework. This means the latest version of the CLI should always be safe for your app, unless you see the major version has changed (which I don't plan on doing for as long as I'm able). If the major version changes, you'll need to take a look at the changelog to see if the breaking changes affect you.
|
I did some testing and it seems to NOT work for ionic@canary. |
I think this issue should be reopened |
I'm experiencing the same issue with a new ionic installation. I started a new project last week. The project only refreshes my sass changes when I restart the server ionic server. Any ideas. |
Hi @dwieeb This may be a related issue, but perhaps not, I just wanted to check. I am on ionic-cli@3.19.0. So in the initial ionic cli v1 and v2 days, I had a gulpfile which basically had the following task in the gulp file, which would run when I ran
This taks would compile my sass as well as my js. That all went well until ionic cli 3 was split out into a separate project, and I had to change this command to:
This all worked great, until it got merged back in, now it does watch and cause a livereload for any html and sass changes, but it ignores any of the js files I am watching as part of my 'default' task. It looks no gulp tasks are being run at the moment, except for the sass one, and not sure how to change that - any help would be greatly appreciated! |
@jacquesdev The Ionic CLI does not run the |
Hi @dwieeb Sure - thanks for assisting on this. It looks something like this:
with the actual watch task looking like this (it's in a separate module):
Please shout if you need to see anything else of the gulpfile. |
@jacquesdev So you're claiming the |
Sure
In the above example, I ran the ionic serve, and then updated a html file to confirm that part of the watch is working. I then updated a js file (in both coffee and es6), and it does not print out anything else. After Just for reference, I have added the actual paths being passed into the watch in my previous comment so that you can see that as well if required. |
@jacquesdev Okay, sounds weird, but do you have |
@dwieeb. You sire are a genius :) I took over this project from a team a while back, and gulp had always been in dependencies and not in devDependencies. I moved it, and when I ran
Thank you sooooooooo much!!!! |
@jacquesdev Awesome! Sorry about that. I will take a look at that weird issue. |
So @dwieeb this partially fixed the issue for me in that I no longer need to run ionic serve for it to compile the scss, but when it refreshes the browser it gives this error : Cannot read property 'indexOf' null (see the attached img for the stack trace) Do you want me to open a new issue to tackle this error? This error always happens when any even valid changes are made to the scss. |
@moscoso Alright. File a new issue, but be sure to update your CLI to the latest version first. |
I am using
Ionic
and I have aGulpfile.js
that worked perfectly before. I updated npm, Angular, Ionic and cordova, which has broken my working environment.Right now, I need to manually start
ionic serve
(or gulp watch) so that it recognizes that I make changes in my .scss file and then compiles it to .cssBefore these updates, I could change my .scss file and it would automatically recognize the changes and compile it to .css instead of me triggering
ionic serve
orgulp watch
manually beforehand.This is what
ionic info
gives me:I am using
xCode
withcordova prepare ios
to deploy it on the iPhone, but as you can understand, because the .css is not compiled automatically, the app does not recognize the css changes as it can not see them if I don't do it manually.How can I fix this?
The text was updated successfully, but these errors were encountered: