Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Can't find import with 0.6.0 #73

Closed
gisu opened this issue Jul 7, 2014 · 10 comments
Closed

Can't find import with 0.6.0 #73

gisu opened this issue Jul 7, 2014 · 10 comments

Comments

@gisu
Copy link

gisu commented Jul 7, 2014

Hi,
i have testet the new Gulp-Ruby-Sass Task 0.6.0.

Gulp 3.8.5
sass-cache is cleaned

After Gulp Compile i get this

[gulp] gulp-ruby-sass: directory
[gulp] gulp-ruby-sass: error ./style-ie8.scss (Line 4: File to import not found or unreadable: _workfile.
Load paths:
  /private/var/folders/8n/yx300rcx6pbfc096xtj82z4m0000gn/T/gulp-ruby-sass/src/scss
  /private/var/folders/8n/yx300rcx6pbfc096xtj82z4m0000gn/T/gulp-ruby-sass)
[gulp] gulp-ruby-sass: error ./style.scss (Line 4: File to import not found or unreadable: _workfile.
Load paths:
  /private/var/folders/8n/yx300rcx6pbfc096xtj82z4m0000gn/T/gulp-ruby-sass/src/scss
  /private/var/folders/8n/yx300rcx6pbfc096xtj82z4m0000gn/T/gulp-ruby-sass)

Only for the understanding. In my config i work in a _workfile.scss, jacket route the stuff in different scss files (style.css, style-ie8.css).

Gulp-Sass Task

// Ruby SASS Task
gulp.task('rubysass', function () {
    gulp.src(['src/scss/**/*.scss','!src/scss/**/_*.scss'])
    .pipe(plumber())
    .pipe(rubysass({
      loadPath: sassLoadPath,
      sourcemap: false,
      style: 'nested',
      precision: 6
    }))
    .on("error", notify.onError(function (error) {
      return "SASS Compile Error: " + error.message;
    }))
    .pipe(prefix("last 2 version", "> 1%", "ie 9", "chrome 30", "firefox 24"))
    .pipe(gulp.dest(targetDirCSS))
    .pipe(notify({message: 'SCSS processed!'}));
});
@MariusRumpf
Copy link

Same here. Sass-Cache cleaned.

Sass 3.3.9 (Maptastic Maple)
gulp-ruby-sass@0.6.0
Mac OSX 10.9.3

[17:42:48] gulp-ruby-sass: error ./main.scss (Line 12: File to import not found or unreadable: modules/page-header.
Load paths:
  /private/var/folders/fy/y51sm1yx2_bc3qtx5xw0yjq80000gn/T/gulp-ruby-sass/app/styles
  /private/var/folders/fy/y51sm1yx2_bc3qtx5xw0yjq80000gn/T/gulp-ruby-sass)

Gulp Sass Task

gulp.task('styles:scss', function () {
    return gulp.src(['app/styles/*.scss'])
        .pipe($.rubySass({
            style: 'expanded',
            precision: 10,
            sourcemap: true,
            sourcemapPath: '.',
            loadPath: ['app/styles']
        }))
        .on('error', function (err) {
          console.log(err);
        })
        .pipe($.autoprefixer(['last 2 versions', '> 1%', 'ie 9', 'ie 10']))
        .pipe(gulp.dest('.tmp/styles'))
        .pipe($.size({title: 'styles:scss'}));
});

@robwierzbowski
Copy link
Contributor

gulp.src(['src/scss/**/*.scss','!src/scss/**/_*.scss'])

You have to pass every file that Sass needs to compile your stylesheets to the gulp.src() glob. This is a change from 5.0.

If you want to fake it with loadPaths, I think they'll need to be absolute paths.

Third person today to post this issue, I'll add to the docs tonight.

@robwierzbowski robwierzbowski changed the title Compile Errors with 0.6.0 Can't find import with 0.6.0 Jul 7, 2014
@UltCombo
Copy link
Contributor

UltCombo commented Jul 7, 2014

@robwierzbowski thanks for the dedication.
p.s. told you it was perhaps worth documenting this breaking change when I reported it 11 days ago. ;)

@robwierzbowski
Copy link
Contributor

@gisu
Copy link
Author

gisu commented Jul 7, 2014

Thanks works now :)

@UltCombo
Copy link
Contributor

UltCombo commented Jul 7, 2014

@robwierzbowski nice and fast work. =]

@davidtheclark
Copy link

@robwierzbowski Am I missing something (?), because I still don't see anything in the readme documenting this.

I do see the sentence "Add the files you want to compile to gulp.src()." but that wasn't enough for me, at least, to understand how I could make this new version work.

The example you give above (gulp.src(['src/scss/**/*.scss','!src/scss/**/_*.scss'])) also didn't really make sense to me, because I actually do need to include the _*.scss that I am @importing for this to work. Right?

The clearest explanation I found was in the release notes:

You'll need to upgrade your gulp.src() globs to contain all the files Sass needs to compile your stylesheets

... and figuring that Sass "needs" the @imported files as well as the manifests.

@robwierzbowski
Copy link
Contributor

@davidtheclark With the latest master you don't need to add all the files needed to compile your stylesheets anymore. You can add one or more stylesheets by themselves just like 0.5.0. To install the latest master, use "gulp-ruby-sass": "git://github.com/sindresorhus/gulp-ruby-sass#f4ced6461f13b29949d587ecdbe42f1ca65720e4".

@davidtheclark
Copy link

Cool, thanks! That's what I missed.

@robwierzbowski
Copy link
Contributor

No problem!

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

No branches or pull requests

5 participants