Skip to content
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

compiled to an empty css file #23

Closed
ghost opened this issue Mar 11, 2013 · 16 comments
Closed

compiled to an empty css file #23

ghost opened this issue Mar 11, 2013 · 16 comments

Comments

@ghost
Copy link

ghost commented Mar 11, 2013

Hello,

I am sorry to bring the problem here cause I think it's not an issue, I just can't find the answer to the problem. I've been goggling and through forums for days now. Kind of desparated.

I am trying to compile scss file using the grunt-contrib-sass plugin (with grunt v0.4.0). The compiled result is an empty css file, but if through Sass, already installed on my pc, it works fine. Below are the base.scss, Gruntfile.js and package.json files.

base.scss

$color: #000;

header{
color: $color;  
}

Gruntfile.js

module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('package.json'),       
    sass: {
        dist: {
            options: { style: "expanded", trace: true },
            files: { "base.css": "base.scss" }
        }       
    }
});

grunt.loadNpmTasks('grunt-contrib-sass');

// Default task.
grunt.registerTask("default", [""]);
grunt.registerTask("sass--",["sass"]);
};

package.json

{
"name": "my_grunt",
"version": "1.0.0",
"description": "New to Grunt",
"main": "index.js",
"scripts": {
    "test": "test"
},
"repository": {
    "type": "git",
    "url": "none"

},
"keywords": [
        "none"
],
"author": "none",
"license": "BSD",
"devDependencies": {
        "grunt-contrib-sass": "~0.2.2"
}
}

Result:

Either I run the sass command "grunt sass" or "grunt sass--", the result is just an empty css file without any errors.

Your help is greatly appreciated

Niusaul

@ghost
Copy link
Author

ghost commented Mar 11, 2013

I am running the same code at home on MAC, and it works fine, the compiled css file (base.css) now has
"header {
color: black;
}"

It looks like something is wrong on the pc at my work?

Please see verbose below.

MacPro:template Chinh$ grunt sass --verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK

Registering "grunt-contrib-sass" local Npm module tasks.
Reading /Users/Chinh/Google Drive/DEV/template/node_modules/grunt-contrib-sass/package.json...OK
Parsing /Users/Chinh/Google Drive/DEV/template/node_modules/grunt-contrib-sass/package.json...OK
Loading "sass.js" tasks...OK

  • sass
    Loading "Gruntfile.js" tasks...OK
  • default, sass--

Running tasks: sass

Running "sass" task

Running "sass:dist" (sass) task
Verifying property sass.dist exists in config...OK
Files: base.scss -> base.css
Options: style="expanded", trace
Reading base.scss...OK
Writing base.css...OK

@zakdances
Copy link

I was experiencing this same issue. grunt-contrib-sass silently fails if the input file name or path is wrong. This should be fixed.

@ghost ghost closed this as completed Mar 12, 2013
@sindresorhus sindresorhus reopened this Mar 12, 2013
@sindresorhus
Copy link
Member

I'm honestly not sure what's wrong here. Though looks like there's a problem on your end since you're the only one reporting this issue.

Did you manage to figure it out?

@ghost
Copy link
Author

ghost commented Apr 9, 2013

The error is caused by the manual config that I've set in the Command Processor (Windows registry), from which I've added an autorun to change the default command prompt.

@robwierzbowski
Copy link
Contributor

I was experiencing this same issue. grunt-contrib-sass silently fails if the input file name or path is wrong. This should be fixed.

Agreed. It took me a couple minutes to figure out what was going on, especially with the "Done, without errors" message.

@sindresorhus
Copy link
Member

@robwierzbowski this task is just using the standard grunt API. This is something that should be in grunt itself if it's deemed needed. Feel free to open an issue about it over at gruntjs/grunt after making sure there isn't already a ticket for it (even closed ones).

@robwierzbowski
Copy link
Contributor

Thanks, will do.

@troyblank
Copy link

I am having this exact same issue using 0.5.0, been using grunt with cygwin with no issues until this, css file is created but is empty. Sass outside of grunt is working fine, node.js is good. using grunt 0.4.1, with node 0.10.19. Verbose mode gives me nothing fishy, I get the following which makes an empty css file:

Running "sass:server" (sass) task
Completed in 0.672s at Wed Sep 25 2013 15:40:14 GMT-0500 (Central Daylight Time) - Waiting...
OK

File "website\styles\styles.css" added.

I am not sure how niusaul was able to come to a fix, I don't have any manual config in registry or anything. Any insight would be greatly appreciated.

@AJ-Acevedo
Copy link

Yup, same issue here on a Mac. All other tasks pass.
I even tested adding bad sass syntax and grunt outputs an error (as expected). so I know it's working correctly, but the output is empty.

Sass version Sass 3.2.10

Gruntfile.js

sass: {
  compile: {
    options: {
      check: true,
      style: 'compressed',
    },
    files: {
      'lists/assets/stylesheets/all.css': 'lists/assets/stylesheets/lists.scss',
    },
  },
},

package.json

  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-jshint": "~0.6.4",
    "grunt-contrib-uglify": "~0.2.4",
    "grunt-contrib-concat": "~0.3.0",
    "grunt-contrib-sass": "~0.5.0",
    "grunt-contrib-watch": "~0.5.3"
  }

Output of grunt

Running "jshint:files" (jshint) task
>> 2 files lint free.

Running "concat:dist" (concat) task
File "lists/assets/javascripts/all.js" created.

Running "sass:compile" (sass) task

Running "uglify:build" (uglify) task
File "lists/assets/javascripts/all.min.js" created.

I ran npm install in the project root today. So everything is up to date.

@AJ-Acevedo
Copy link

Looks like the issue is with the sass option check: true,.
By removing the sass option check: true, it worked as expected.

Maybe this issue should be reopened?

@synhershko
Copy link

I'm hitting this as well, with 0 changes made to the original Gruntfile. Running grunt server compiles everything nicely and I can view it just fine locally. Its when I try to get a deployable version that this fails. Probably grunt is unable to copy the .tmp/styles/* files?

@robwierzbowski
Copy link
Contributor

Are you using usemin?

On Sunday, October 6, 2013, Itamar Syn-Hershko wrote:

I'm hitting this as well, with 0 changes made to the original Gruntfile.
Running grunt server compiles everything nicely and I can view it just fine
locally. Its when I try to get a deployable version that this fails.
Probably grunt is unable to copy the .tmp/styles/* files?


Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-25769991
.

Rob Wierzbowski
@robwierzbowski http://twitter.com/#!/robwierzbowski
http://github.com/robwierzbowski
http://robwierzbowski.com

@synhershko
Copy link

In my grunt build task - yes

There seem to be an issue with cssmin tho - it prevented the files from being copied from .tmp to dist. Fixed it by using:

-      // dist: {
-      //   files: {
-      //     '<%= yeoman.dist %>/styles/main.css': [
-      //       '.tmp/styles/{,*/}*.css',
-      //       '<%= yeoman.app %>/styles/{,*/}*.css'
-      //     ]
-      //   }
-      // }
+      dist: {
+         files: {
+           '<%= yeoman.dist %>/styles/main.css': [
+             '.tmp/styles/{,*/}*.css',
+             '<%= yeoman.app %>/styles/{,*/}*.css'
+           ]
+         }
+       }

Are there more issues I should be aware of?

@troyblank
Copy link

I figured out what my issue was anyway.

around line 58 of sass.js there is an if statement that makes the command sass.bat instead of sass if the process.platform is 'win32' ... because sass runs just fine on windows I commented out the if statement and left the command to be set to 'sass' always... this fixed my issue and I am now getting a populate css file.

@troyblank
Copy link

Also to further explain sass.bat had permission denied errors otherwise this might work using cygwin... the only error handling on the spawn is if sass or ruby is not installed, this might be expanded to permission errors as well, or maybe a catch all, just food for thought.

@jebaraj2016
Copy link

Hi ,
I couldn't execute my grunt files

grunt -v

Gruntfile.js
63 | NODE_ENV : 'unit-test',
^ [W108] Strings must use doublequote.
64 | DEST : 'temp'
^ [W108] Strings must use doublequote.
core/logger/index.js
55 |function formatter(args){
^ [W003] 'formatter' was used before it was defined.
56 | return moment().format('MM/DD/YY hh:mm:ss a') + ' - ' + args.level + ': ' + args.message;
^ [W108] Strings must use doublequote.
56 | return moment().format('MM/DD/YY hh:mm:ss a') + ' - ' + args.level + ': ' + args.message;
^ [W108] Strings must use doublequote.
56 | return moment().format('MM/DD/YY hh:mm:ss a') + ' - ' + args.level + ': ' + args.message;
^ [W108] Strings must use doublequote.
core/server/api/applications.js
81 | var application = new Application();
^ [W117] 'Application' is not defined.
1 |var mongoose = require("mongoose"),
^ [W098] 'mongoose' is defined but never used.
5 | dataProvider = require("../models"),
^ [W098] 'dataProvider' is defined but never used.
core/server/api/droptickets.js
17 | for (var property in options) {
^ [W089] The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.
42 | })
^ [W033] Missing semicolon.
1 |var mongoose = require("mongoose"),
^ [W098] 'mongoose' is defined but never used.
5 | dataProvider = require("../models"),
^ [W098] 'dataProvider' is defined but never used.
core/server/api/settings.js
1 |var mongoose = require("mongoose"),
^ [W098] 'mongoose' is defined but never used.
core/server/api/taxonomy.js
1 |var mongoose = require("mongoose"),
^ [W098] 'mongoose' is defined but never used.
core/server/api/users.js
29 | var User = db.model('User');
^ [W108] Strings must use doublequote.
31 | var Business = db.model('Business');
^ [W108] Strings must use doublequote.
64 | var promise = when.promise(function (resolve, reject) {
^ [W098] 'reject' is defined but never used.
62 | getMe: function (options) {
^ [W098] 'options' is defined but never used.
73 | var User = db.model('User');
^ [W108] Strings must use doublequote.
1 |var mongoose = require("mongoose"),
^ [W098] 'mongoose' is defined but never used.
5 | dataProvider = require("../models"),
^ [W098] 'dataProvider' is defined but never used.
core/server/index.js
10 | res.header('Access-Control-Allow-Origin', '');
^ [W108] Strings must use doublequote.
10 | res.header('Access-Control-Allow-Origin', '
');
^ [W108] Strings must use doublequote.
11 | res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, apikey, Authorization');
^ [W108] Strings must use doublequote.
11 | res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, apikey, Authorization');
^ [W108] Strings must use doublequote.
13 | }).options('', function(req, res, next){
^ [W108] Strings must use doublequote.
13 | }).options('
', function(req, res, next){
^ [W098] 'next' is defined but never used.
15 | })
^ [W033] Missing semicolon.
39 | var server = app.listen(config.get("server:port"));
^ [W098] 'server' is defined but never used.
42 | })
^ [W033] Missing semicolon.
63 | server.close();
^ [W117] 'server' is not defined.
core/server/middleware/index.js
26 | var UserModel = mongoose_instance.getDatabase().model('User');
^ [W108] Strings must use doublequote.
41 | var UserModel = mongoose_instance.getDatabase().model('User');
^ [W108] Strings must use doublequote.
50 | return done(null, user, { scope: 'all' });
^ [W108] Strings must use doublequote.
60 | passport.authenticate("local", function (err, user, info) {
^ [W098] 'info' is defined but never used.
75 | passport.authenticate("bearer", function (err, user, info) {
^ [W098] 'info' is defined but never used.
98 | var ApplicationModel = mongoose_instance.getDatabase().model('Application');
^ [W108] Strings must use doublequote.
2 | dataProvider = require("../models"),
^ [W098] 'dataProvider' is defined but never used.
5 | User = require("../models").User,
^ [W098] 'User' is defined but never used.
core/server/models/application.js
21 | user_id: {type: Schema.ObjectId, ref: 'User', default: null},
^ [W108] Strings must use doublequote.
27 | this.model('Application').findOne({ apikey: appData.apikey }, function (err, application) {
^ [W108] Strings must use doublequote.
39 |}
^ [W033] Missing semicolon.
42 | var model = this.model('Application');
^ [W108] Strings must use doublequote.
43 | var application = new model();
^ [W055] A constructor name should start with an uppercase letter.
51 |}
^ [W033] Missing semicolon.
65 | var model = this.model('Application');
^ [W108] Strings must use doublequote.
66 | var application = new model(record);
^ [W055] A constructor name should start with an uppercase letter.
77 |}
^ [W033] Missing semicolon.
80 | var model = this.model('Application');
^ [W108] Strings must use doublequote.
81 | var applicationModel = new model();
^ [W055] A constructor name should start with an uppercase letter.
105 |}
^ [W033] Missing semicolon.
108 | this.model('Application').findOne({ id: helper.mongoObjectId(data.id) }, function (err, application) {
^ [W108] Strings must use doublequote.
120 |}
^ [W033] Missing semicolon.
124 | var model = this.model('Application');
^ [W108] Strings must use doublequote.
125 | var application = new model();
^ [W055] A constructor name should start with an uppercase letter.
153 |}
^ [W033] Missing semicolon.
9 | Application,
^ [W098] 'Application' is defined but never used.
11 | ApplicationModel,
^ [W098] 'ApplicationModel' is defined but never used.
155 |function getApplicationByApiKey(appData, callback) {
^ [W098] 'getApplicationByApiKey' is defined but never used.
core/server/models/authentication.js
14 | user_id: {type: Schema.ObjectId, ref: 'User'},
^ [W108] Strings must use doublequote.
21 |}
^ [W033] Missing semicolon.
1 |var _ = require("lodash"),
^ [W098] '
' is defined but never used.
2 | jwt = require("jwt-simple"),
^ [W098] 'jwt' is defined but never used.
3 | mongo = require("../../db/mongo"),
^ [W098] 'mongo' is defined but never used.
5 | logger = require("../../logger"),
^ [W098] 'logger' is defined but never used.
6 | errors = require("../helpers").errors,
^ [W098] 'errors' is defined but never used.
7 | helper = require("../helpers"),
^ [W098] 'helper' is defined but never used.
8 | filteredAttributes = ["_id", "password"],
^ [W098] 'filteredAttributes' is defined but never used.
core/server/models/business.js
25 | this.model('Business').findOne({ bid: data.bid}, function (err, business) {
^ [W108] Strings must use doublequote.
37 |}
^ [W033] Missing semicolon.
42 |}
^ [W033] Missing semicolon.
2 | jwt = require("jwt-simple"),
^ [W098] 'jwt' is defined but never used.
3 | mongo = require("../../db/mongo"),
^ [W098] 'mongo' is defined but never used.
7 | helper = require("../helpers"),
^ [W098] 'helper' is defined but never used.
core/server/models/index.js
1 |var mongoose = require('mongoose'),
^ [W108] Strings must use doublequote.
3 | ApplicationSchema = require('./application').ApplicationSchema,
^ [W108] Strings must use doublequote.
4 | UserSchema = require('./user').UserSchema,
^ [W108] Strings must use doublequote.
5 | AuthenticationSchema = require('./authentication').AuthenticationSchema,
^ [W108] Strings must use doublequote.
6 | BusinessSchema = require('./business').BusinessSchema,
^ [W108] Strings must use doublequote.
7 | SettingSchema = require('./setting').SettingSchema,
^ [W108] Strings must use doublequote.
8 | TaxonomySchema = require('./taxonomy').TaxonomySchema,
^ [W108] Strings must use doublequote.
13 | db.model('Application', ApplicationSchema);
^ [W108] Strings must use doublequote.
13 | db.model('Application', ApplicationSchema);
^ [W030] Expected an assignment or function call and instead saw an expression.
14 | db.model('User', UserSchema);
^ [W108] Strings must use doublequote.
15 | db.model('Authentication', AuthenticationSchema);
^ [W108] Strings must use doublequote.
16 | db.model('Business', BusinessSchema);
^ [W108] Strings must use doublequote.
17 | db.model('Setting', SettingSchema);
^ [W108] Strings must use doublequote.
18 | db.model('Taxonomy', TaxonomySchema);
^ [W108] Strings must use doublequote.
19 |}
^ [W033] Missing semicolon.
12 | db = mongoose_instance.getDatabase(),
^ [W117] 'db' is not defined.
13 | db.model('Application', ApplicationSchema);
^ [W117] 'db' is not defined.
14 | db.model('User', UserSchema);
^ [W117] 'db' is not defined.
15 | db.model('Authentication', AuthenticationSchema);
^ [W117] 'db' is not defined.
16 | db.model('Business', BusinessSchema);
^ [W117] 'db' is not defined.
17 | db.model('Setting', SettingSchema);
^ [W117] 'db' is not defined.
18 | db.model('Taxonomy', TaxonomySchema);
^ [W117] 'db' is not defined.
1 |var mongoose = require('mongoose'),
^ [W098] 'mongoose' is defined but never used.
core/server/models/setting.js
24 | this.model('Setting').findOne({ bid: data.bid }, function (err, setting) {
^ [W108] Strings must use doublequote.
36 |}
^ [W033] Missing semicolon.
3 | mongo = require("../../db/mongo"),
^ [W098] 'mongo' is defined but never used.
6 | Setting,
^ [W098] 'Setting' is defined but never used.
8 | SettingModel,
^ [W098] 'SettingModel' is defined but never used.
core/server/models/taxonomy.js
16 |}, {collection: 'taxonomies'});
^ [W108] Strings must use doublequote.
19 | this.model('Taxonomy').findOne({ bid: data.bid }, function (err, setting) {
^ [W108] Strings must use doublequote.
31 |}
^ [W033] Missing semicolon.
3 | mongo = require("../../db/mongo"),
^ [W098] 'mongo' is defined but never used.
6 | Taxonomy,
^ [W098] 'Taxonomy' is defined but never used.
8 | TaxonomyModel,
^ [W098] 'TaxonomyModel' is defined but never used.
core/server/models/user.js
30 |UserSchema.pre('save', function(next) {
^ [W108] Strings must use doublequote.
32 | if (!user.isModified('password')) return next();
^ [W108] Strings must use doublequote.
32 | if (!user.isModified('password')) return next();
^ [W116] Expected '{' and instead saw 'return'.
49 | var model = this.model('User');
^ [W108] Strings must use doublequote.
50 | var user = new model(data);
^ [W055] A constructor name should start with an uppercase letter.
52 | user.save(function (err) {
^ [W098] 'err' is defined but never used.
56 |}
^ [W033] Missing semicolon.
59 | var Authentication = mongoose_instance.getDatabase().model('Authentication', AuthenticationSchema);
^ [W108] Strings must use doublequote.
60 | this.model('User').findOne({ email: data.email }, function (err, user) {
^ [W108] Strings must use doublequote.
99 |}
^ [W033] Missing semicolon.
102 | var Authentication = mongoose_instance.getDatabase().model('Authentication', AuthenticationSchema);
^ [W108] Strings must use doublequote.
126 |}
^ [W033] Missing semicolon.
129 | var Authentication = mongoose_instance.getDatabase().model('Authentication', AuthenticationSchema);
^ [W108] Strings must use doublequote.
130 | var userModel = this.model('User');
^ [W108] Strings must use doublequote.
153 |}
^ [W033] Missing semicolon.
156 | this.model('User').findOne({ email: data.email }, function (err, user) {
^ [W108] Strings must use doublequote.
170 |}
^ [W033] Missing semicolon.
173 | this.model('User').findOne({ _id: helper.mongoObjectId(data.id) }, function (err, user) {
^ [W108] Strings must use doublequote.
186 |}
^ [W033] Missing semicolon.
36 | return cb(errors.SERVER_ERROR);
^ [W117] 'cb' is not defined.
40 | return cb(errors.SERVER_ERROR);
^ [W117] 'cb' is not defined.
5 | mongo = require("../../db/mongo"),
^ [W098] 'mongo' is defined but never used.
core/server/routes/index.js
9 | User = require("../models").User,
^ [W098] 'User' is defined but never used.
10 | errors = require("../helpers").errors,
^ [W098] 'errors' is defined but never used.
core/server/routes/settings.js
2 | middleware = require("../middleware"),
^ [W098] 'middleware' is defined but never used.
core/server/routes/taxonomy.js
2 | middleware = require("../middleware"),
^ [W098] 'middleware' is defined but never used.
test/functional/api/payments_test.js
166 | service_fee: .50
^ [W008] A leading decimal point can be confused with a dot: '.50'.
191 | service_fee: .50,
^ [W008] A leading decimal point can be confused with a dot: '.50'.
192 | tip_rate: .30
^ [W008] A leading decimal point can be confused with a dot: '.30'.
217 | service_fee: .50,
^ [W008] A leading decimal point can be confused with a dot: '.50'.
218 | tip_rate: .30,
^ [W008] A leading decimal point can be confused with a dot: '.30'.

140 errors in 39 files
Warning: Task "jshint:files" failed. Use --force to continue.

Aborted due to warnings.
root@helpdesk:/var/www/html/dev/api# cd ..
root@helpdesk:/var/www/html/dev# cd dashboard/
root@helpdesk:/var/www/html/dev/dashboard# grunt
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.

Please help out this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants