Error Generating Source Map - Grunt and SASS Configuration

Error generating source map - grunt and sass configuration

Looks like you don't have compass installed. You can run gem install compass. In your original example you had your grunt file set up to use compass which would have given you access to compass mixins and features.

Your code looks fine now and should work but seems to not be finding your files. I'll GI e it a go as well when I'm next to a computer.

In the meantime you can try the sourcemap: none option on the sass task.

Update:

Works perfectly fine for me. Could you run tree -I node_modules and post the output(unless you think there's any sensitive info) just to double check the files are in the right place?

I expect it to look something like this

.
├── Gruntfile.js
├── package.json
├── sass
│   └── style.scss
└── style
├── style.css
└── style.css.map

Second update:
Your packages seem significantly older than what's in my fresh setup. Either try starting from scratch or do the following:

Install npm-check-updates

npm install npm-check-updates 

And then run the following

  • npm-check-updates will tell you which packages are outdated
  • npm-check-updates -u will update those packages in your package.json
  • npm update to update all your outdated packages.

Error using Grunt watch and SASS

Try to disable sourcemap and see if it works.

module.exports = function(grunt) {    grunt.initConfig({        pkg: grunt.file.readJSON('package.json'),        sass: {            dist: {                options: {                    style: 'compressed',                    sourcemap: 'none'                },                files: {                    'css/style.css' : 'sass/style.scss'                }            }        },        watch: {            css: {                files: '**/*.scss',                tasks: ['sass'],                options: {                    spawn: false                }            }        },    });
grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default',['watch']);}

Error: Could not find an option named sourcemap when running SASS and Grunt

I had found a way to resolve this issue. In the above question, I tried to install SASS using NPN. But instead of doing that, I tried to install SASS using Ruby-Gem.

Following are the set of commands that I used to resolve this issue:

curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm reload
rvm requirements run
rvm install 2.7
gem install sass:3.7.4

Ruby Version: 2.7

SASS Version: 3.7.4

By doing so, I was able to install SASS the proper way and everything worked as expected.

Thanks!

grunt compass Error: invalid option --sourcemap

Execute "gem list" so we can have more details on what gem versions you're using.

AFAIK the sourcemap works since sass 3.3 and up.

If you want to disable the sourcemap on your project, check your config.rb file and check the sass_options entry, you might find ":sourcemap => true". If you find it, remove it and check it out.

Hope it helps!

grunt-contrib-sass throwing Could not find an option named errors

I solved this by deleting the node_modules folder and letting Visual Studio repopulate this folder.

grunt contrib-sass sourcemap enable

Just to provide this as an actual answer, sourcemaps aren't available in sass stable yet. They're being worked on in an alpha release. The original question referenced a commit message that noted the code was being future-proofed.

As of 6/24/2013, sourcemaps aren't available in grunt-contrib-sass or grunt-contrib-compass.



Related Topics



Leave a reply



Submit