Melbourne2991
Melbourne2991

Reputation: 11797

Compass with grunt "File to import not found or unreadable"

I am having issues importing compass, it's definitely installed (gem list confirms that), breakpoint and susy work fine but it doesn't like the compass import...

Error:

Error: File to import not found or unreadable: compass.
   Load paths:
     /Users/xx/dev/roomfully/listaroom-app
     /Users/xx/.rvm/gems/ruby-2.1.1/gems/susy-2.2.2/sass
     /Users/xx/.rvm/gems/ruby-2.1.1/gems/breakpoint-2.5.0/stylesheets
    on line 1 of public/sass/app.scss
Use --trace for backtrace.

Gruntfile

module.exports = function(grunt) {
    grunt.initConfig({
        sass: {
            dist: {
                options: {
                    require: [
                        'susy', 
                        'breakpoint', 
                        'compass', 
                        'compass-normalize'
                    ]
                },
                files: {
                    'public/app.css': 'public/sass/app.scss'
                }
            }
        },
        watch: {
            dist: {
                files: 'public/sass/*.scss',
                tasks: ['sass']
            }
        }
    });

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

app.scss

@import 'compass';
@import 'compass-normalize';
@import 'breakpoint';
@import 'susy';

body {
    display: none
}

Upvotes: 0

Views: 2300

Answers (3)

Parag Bhayani
Parag Bhayani

Reputation: 3330

To add on top of your answer @pramod, The error that blocks compass build is "File to import not found or unreadable: compass" is because NTFS limitation of 256 characters on path strings.

This also happened to me importing theme sass files about my app sources that must respect my project hierarchy.

I think that compass resolve the absolute path concatenating relative ones, wasting a lot of chars ("C:\a\b\c....\b\c\d" instead of "C:\a\b\c\d").

Upvotes: 1

F0rG0tTeN
F0rG0tTeN

Reputation: 96

I solved this problem as below :- There was a problem of path resolution by compass as all the paths mentioned are relative paths of the dependencies. Try to make the total path length smaller. I had too much hierarchical folder structure as a result when the total path was resolved, it was greater than the allowed length. try putting your folder(containing the whole project structure) directly in C drive.

Upvotes: 1

weimin
weimin

Reputation: 41

There is an answer about this question, File to import not found or unreadable: compass, but before you check this link, maybe you can try to set sass option "compass: true", like this:

sass: {
  options: {
    compass: true
  }
}

Upvotes: 4

Related Questions