Search code examples
csscompiler-errorscompass

Compass error: File to import not found or unreadable


Just added Compass filters to my code base.

// This file is main.scss
@import "breakpoint";
@import "compass/css3";
@import "compass/css3/user-interface";
@import "compass/css3/transform";
// Just added filters.
@import "compass/css3/filters";
@import "compass/utilities/general/clearfix";

@import "base/base";
@import "views/views";

Now the Compass compile task is failing and giving the following error:

error wp-content/themes/example/styles/main.scss (Line 5: File to import not found or unreadable: compass/css3/filters.
Load paths:
  Compass::SpriteImporter
  /Users/me/example/wp-content/themes/example/styles
  /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/stylesheets
  /Library/Ruby/Gems/2.0.0/gems/sassy-maps-0.4.0/sass
  /Library/Ruby/Gems/2.0.0/gems/breakpoint-2.5.0/stylesheets)
Compilation failed in 1 files.
Warning: ↑ Use --force to continue.

Aborted due to warnings.

I'm probably missing an obvious step in my Compass setup. But yes, the compilation was working fine before adding filters.


Solution

  • You have a typo. The correct synatax is:

    @import "compass/css3/filter"; // <-- Note 'filter', not 'filters'

    See the Compass documentation.