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

gulp-ruby-sass can't find @import'd files #63

Closed
UltCombo opened this issue Jun 27, 2014 · 3 comments
Closed

gulp-ruby-sass can't find @import'd files #63

UltCombo opened this issue Jun 27, 2014 · 3 comments

Comments

@UltCombo
Copy link
Contributor

Test case file structure:

scss/app.scss

@import "mixins";
// ...

scss/_mixins.scss

// some outputable CSS, just for test case's sake
.foo { color: green; }

Throws:

[01:46:18] gulp-ruby-sass: error ./app.scss (Line 1: File to import not found or unreadable: mixins.
Load path: C:/Users/Ult/AppData/Local/Temp/gulp-ruby-sass)

Now if I add the absolute path to the scss directory in the loadPath option, it compiles but the sourcemap throws an warning as in #47 (can't determine the source files' public URL).

I believe I shouldn't have to add an absolute path to loadPath in order to @import using paths relative to the current scss file, this appears to be a regression bug.

When not providing a loadPath, the directory C:/Users/Ult/AppData/Local/Temp/gulp-ruby-sass contains a copy of app.scss and a directory _14139e58-9ebe-4c0f-beca-73a65bb01ce9 containing the output css file whose content is:

/*
Syntax error: File to import not found or unreadable: mixins.
              Load path: C:/Users/Ult/AppData/Local/Temp/gulp-ruby-sass
        on line 1 of ./app.scss

1: @import "mixins";
2: 
3: html {
4:  height: 100%;
5:  background: linear-gradient(darken(lightblue, 10%), slateblue) fixed;
6: }

Backtrace:
./app.scss:1
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/import_node.rb:66:in `rescue in import'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/import_node.rb:45:in `import'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/import_node.rb:28:in `imported_file'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/import_node.rb:37:in `css_import?'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:283:in `visit_import'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/base.rb:36:in `visit'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:152:in `block in visit'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/stack.rb:79:in `block in with_base'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/stack.rb:121:in `with_frame'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/stack.rb:79:in `with_base'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:152:in `visit'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/base.rb:52:in `map'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/base.rb:52:in `visit_children'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:161:in `block in visit_children'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:173:in `with_environment'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:160:in `visit_children'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/base.rb:36:in `block in visit'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:180:in `visit_root'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/base.rb:36:in `visit'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:151:in `visit'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/visitors/perform.rb:8:in `visit'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/root_node.rb:36:in `css_tree'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/tree/root_node.rb:29:in `render_with_sourcemap'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/engine.rb:371:in `_render_with_sourcemap'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/engine.rb:291:in `render_with_sourcemap'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-import-once-1.0.3/lib/compass/import-once/engine.rb:23:in `block in render_with_sourcemap'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-import-once-1.0.3/lib/compass/import-once/engine.rb:29:in `with_import_scope'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-import-once-1.0.3/lib/compass/import-once/engine.rb:22:in `render_with_sourcemap'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/plugin/compiler.rb:412:in `update_stylesheet'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/plugin/compiler.rb:189:in `block in update_stylesheets'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/plugin/compiler.rb:186:in `each'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/plugin/compiler.rb:186:in `update_stylesheets'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/plugin.rb:82:in `update_stylesheets'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/exec.rb:489:in `watch_or_update'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/exec.rb:346:in `process_result'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/exec.rb:43:in `parse'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/lib/sass/exec.rb:22:in `parse!'
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.3.7/bin/sass:13:in `<top (required)>'
c:/Ruby200-x64/bin/sass:23:in `load'
c:/Ruby200-x64/bin/sass:23:in `<main>'
*/

Running node 0.10.26, gulp 3.8.3, latest gulp-ruby-sass (git://github.com/sindresorhus/gulp-ruby-sass.git#83bce4ce1317185add687934c3ec77db3cf0cba6), Windows 7 x64 Ultimate.

@UltCombo
Copy link
Contributor Author

I haven't read the latest source but believe that gulp-ruby-sass copies the .scss file to a temp dir and executes Sass on that copy, right? If so, the relative paths in the scss file are relative to the temp dir, which does not contain the _mixins.scss file that I'm trying to @import.

@robwierzbowski
Copy link
Contributor

Your source glob has to include all of your Sass files. Is there a reason
you're not including the mixins file?

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

On Fri, Jun 27, 2014 at 1:22 AM, Fabrício Matté notifications@github.com
wrote:

I haven't read the latest source but believe the gulp-ruby-sass copies the
.scss file to a temp dir and executes Sass on that copy, right? If so,
the relative paths in the scss file are relative to the temp dir, which
does not contain the _mixins.scss file that I'm trying to @import.


Reply to this email directly or view it on GitHub
#63 (comment)
.

@UltCombo
Copy link
Contributor Author

@robwierzbowski oh no reason really, it's just that that way works with grunt-contrib-sass and worked with gulp-ruby-sass as well until not long ago.

Thanks, this fixes the compilation issues. Might be worth adding a note about this somewhere if there isn't one yet.

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

2 participants