Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'It's not clear which file to import' error message #3

Closed
ivostork opened this issue Jan 2, 2013 · 53 comments
Closed

'It's not clear which file to import' error message #3

ivostork opened this issue Jan 2, 2013 · 53 comments

Comments

@ivostork
Copy link

ivostork commented Jan 2, 2013

Hey,
I've changed my imports from this"

@import "extensions/content/css-hack";
@import "extensions/content/grid";
@import "extensions/content/media";
@import "extensions/content/misc";
@import "extensions/content/table";
@import "extensions/content/mod";
@import "extensions/content/forms";

to this:

@import "extensions/content/*";

Added require 'sass-globbing' to config.rb

but I am getting this message when compiling..

It's not clear which file to import for '@import"extensions/content/*"'.
Candidates:
extensions/content/_css-hack.scss
extensions/content/_forms.scss
extensions/content/_grid.scss
extensions/content/_media.scss
extensions/content/_misc.scss
extensions/content/_mod.scss
extensions/content/_oocssgrid.scss
extensions/content/_table.scss
For now I'll choose _css-hack.scss.
This will be an error in future versions of Sass

Any ideas what could be wrong here?

This is my gem list
*** LOCAL GEMS ***

addressable (2.2.6)
chunky_png (1.2.4)
compass (0.12.2)
compass-validator (3.0.1)
css_parser (1.2.5)
fssm (0.2.7)
minitest (1.6.0)
modular-scale (1.0.2, 1.0.1)
rake (0.8.7)
rdoc (2.5.8)
sass (3.2.2, 3.2.0.alpha.247)
sass-globbing (1.0.0)
sassy-math (1.2)
susy (1.0.rc.4)
webfontspecimen (0.3.0)

@SequenceLabs
Copy link

I have the exact same problem. I've used this successfully with Middleman but doesn't want to work with just SASS.

@ixisio
Copy link

ixisio commented Feb 27, 2013

I think this issue only exists on windows. on mac everything works fine!

any suggestions?

@hiulit
Copy link

hiulit commented May 22, 2013

Same here.

@import "modules/typebox/*";

WARNING: On line 26 of D:/Project/sass/styles.scss:
It's not clear which file to import for '@import "modules/typebox/*"'.
Candidates:
modules/typebox/_extend.scss
modules/typebox/_mixins.scss
modules/typebox/_module-typebox.scss
modules/typebox/_extend.scss
modules/typebox/_mixins.scss
modules/typebox/_module-typebox.scss
For now I'll choose _extend.scss.
This will be an error in future versions of Sass.

I have Windows 8 and I'm getting the same error. Tried it on a Mac and no complains at all.

Any progress on this issue?

@chriseppstein
Copy link
Owner

Fixed by 606b853. Please install sass-globbing version 1.1.0.pre.0 and let me know if it works for you.

@chriseppstein
Copy link
Owner

@hiulit can you test this and report back?

@hiulit
Copy link

hiulit commented Jun 10, 2013

Hi @chriseppstein
How can I install version 1.1.0.pre.0?
I've just installed sass-globbing again using 'gem install' and I'm getting 1.1.0

Thanks!

@chriseppstein
Copy link
Owner

@hiulit 1.1.0 is the released version of 1.1.0.pre.0. So you're good to go. But in the future you can do one of the following:

gem install --pre <gem name>

or

gem install --version <specific version> <gem name>

@azanebrain
Copy link

Tried both methods for installing but still getting the same error.

Running on Windows 8 .. X{

@hiulit
Copy link

hiulit commented Jun 11, 2013

Same here :(

@dinhhien102
Copy link

I have same problem when running on win 7,8. really need your help, fix please.

@1stevengrant
Copy link

I'm seeing this issue on Windows 7 even after installing 1.1.0.pre.0

@chriseppstein
Copy link
Owner

Grrrrr.

@chriseppstein chriseppstein reopened this Jun 26, 2013
@voigtan
Copy link

voigtan commented Jul 3, 2013

I also have that problem, could be that I´m trying with grunt and compass

@vlad-stratulat
Copy link

Any updates in this?

@lolmaus
Copy link

lolmaus commented Aug 5, 2013

I've got a single file in a directory that it try load using @import base/variables/*, i recieve this:

WARNING: On line 2 of path/to/my/project/sass/style.sass:
  It's not clear which file to import for '@import "base/variables/*"'.
  Candidates:
    base/variables/_grids.sass
    base/variables/_grids.sass
  For now I'll choose _grids.sass.
  This will be an error in future versions of Sass.

Pretty weird.

PS Windows 7 x64 Pro.

@Mumpitz
Copy link

Mumpitz commented Aug 13, 2013

Hi, same here. Win7 x64 Pro
At work with a Mac, no problems.

Installed rubyinstaller-2.0.0, with this sass and sass-globbing some minutes ago. No Compass or something similar. Im working from command line.

@markweston
Copy link

I'm running:

  • Windows 7 64bit
  • Ruby 1.9.3 (32bit)
  • Ruby Gems 1.8.24
  • sass-globbing v1.1.0
  • sass v3.2.9

I was having the same issue as discussed above which originated from the following lines in one of my sass files:
@import "utility/variables/";
@import "utility/__/
";

The first line is where sass globbing fails, but the second line works fine. After some trouble shooting with colleagues, one tried out using a double star in the first line:
@import "utility/variables/**";

This now works fine, the file and tree imports both work and there are no errors. My colleague working on Linux pulled my changes and the first time Guard picked up the changed sass files it seemed to get a little confused and compiled the css about 10 times and then stopped. It now works as normal, no issues with multiple compilation.

Could there be an issue with the use of the single * on windows?

@hkirsman
Copy link

hkirsman commented Sep 2, 2013

Doesn't work for me.

And how it suppose to work when compiling specific files? Like this:
sass -r sass-globbing global.scss global.css
?

@itsravenous
Copy link

I can confirm @markweston's 'double star' fix works for me.

Windows 7
compass 0.12.2
sass 3.2.9
sass-globbing 1.1.0

@lolmaus
Copy link

lolmaus commented Sep 23, 2013

I need to require all files in a directory without recursing into subdirectories.

Is there a non-buggy way to do that on Windows?

@itsravenous
Copy link

@lolmaus Not as far as I'm aware. If you're lucky, you'll have the flexibility/control over your project to structure your folders so that isn't required. If not, then I think you're out of luck for the moment, unless you fancy setting up a Linux Virtualbox to build your project :)

@lolmaus
Copy link

lolmaus commented Sep 23, 2013

@itsravenous, thank you for replying. I'd rather import my partials manually than do major restructuring.

As for Linux VirtualBox, i do use one for projects that have requirerements incompatible with Windows. But that's rather burdensome and i don't consider Sass Globbing to be such a requirement. So i'll wait for now.

This buggy behavior has appeared only recently, the gem worked fine before. Isn't it possible to trace which code modification causes this issue?

@itsravenous
Copy link

@lolmaus I'm sure it is - you can install old versions of ruby gems with the -v option:

gem install sass-globbing -v 1.0.0

I just tried some of the old versions and couldn't find one that didn't reproduce the error, including the first version I could find, 1.0.0.rc.1.

There's a list of all versions (according to RubyGems, anyway) at http://rubygems.org/gems/sass-globbing/versions. Be interested to see how you get on.

@lolmaus
Copy link

lolmaus commented Sep 29, 2013

@itsravenous, you're right. All versions of sass-globbing are affected by this. :(

Any developments on this one?

@deigolocco
Copy link

just try @import folder/.;

@lolmaus
Copy link

lolmaus commented Oct 16, 2013

Hey @deigolocco, this is working fine on Windows!

I knew i had it working but i forgot how. Now we know, this is a valid workaround! Thank you @deigolocco.

@itsravenous
Copy link

Glad you found a workaround - will remember this if I ever need to avoid recursion :)

@markweston
Copy link

@deigolocco what does the . actually represent?

@deigolocco
Copy link

@markweston I think windows needs more specificity, instead of /, /.*

@itsravenous
Copy link

@deigolocco is correct - historically, in DOS:

dir *

would only have listed files without an extension (which were very rare - DOS convention dictated a three letter extension).

dir *.*

would, however, list all files.

@markweston
Copy link

To confirm the solution @itsravenous suggested works.

@intensr
Copy link

intensr commented Aug 13, 2014

I've still got the issue.
My specs:

  • Win8 64bit
  • rubygems-update (2.4.1, 2.2.2)
  • sass (3.3.14, 3.2.19, 3.2.14)
  • sass-globbing (1.1.1, 1.1.0) [Also tried the gem sass-globbing-pr-20]
  • compass (0.12.7, 0.12.2)

My gruntfile (compass part)

    compass: {
        options: {  
            require: 'sass-globbing',
            sassDir: 'sass',
            relativeAssets: true,
            cssDir: '../css',
            imageDir: '../img',
            generatedImagesDir: '../img',
            cacheDir: 'cache',
            debugInfo: false,
            noLineComments: true
        },
        dev: {
            options: {
                outputStyle: 'compact'
            }
        },
        dist: {
            options: {
                outputStyle: 'compressed'
            }
        }
    },

My dev dependencies

  devDependencies: {
    "grunt": "^0.4.2",
    "grunt-contrib-concat": "^0.3.0",
    "grunt-contrib-uglify": "^0.3.2",
    "grunt-contrib-watch": "^0.5.3",
    "grunt-contrib-compass": "^0.7.2",
    "grunt-autoprefixer": "^0.7.1",
    "grunt-mkdir": "^0.1.1",
    "grunt-contrib-copy": "^0.5.0",
    "grunt-contrib-clean": "^0.5.0",
    "load-grunt-tasks": "^0.4.0",
    "grunt-newer": "^0.7.0"
  }

Iam using grunt-contrib-compass instead of grunt-contrib-sass does this make any difference ?

I used this

@import "test/*";

Running "compass:dev" (compass) task
WARNING: On line 69 of D:/var/www/augmented-wordpress-post/build/sass/config/_imports.scss:
It's not clear which file to import for '@import "test/*"'.
Candidates:
test/_placeholder.scss
test/_placeholder2.scss
test/_placeholder3.scss
test/_placeholder.scss
test/_placeholder2.scss
test/_placeholder3.scss
For now I'll choose _placeholder.scss.
This will be an error in future versions of Sass.

and this

" @import "test/*.*";

/* No files to import found in test/. */ (comment in .css)

Can anyone help me ?

@Kcko
Copy link

Kcko commented Sep 3, 2014

Still not work.

with '/mark' i get error It's not clear which file to import for bla bla bla
with '/mark dot mark ' i get sass error Syntax error: File to import not found or unreadable: skelet/_banners.scss bla bla (long error).

Any help or fix by author?

@intensr
Copy link

intensr commented Sep 3, 2014

Hey Kcko maybe this helps you.
I personally forgot to read this part "Globs are always relative to the current file. The ruby glob file syntax is used, read the docs for more that you can do with it." So:

@import "plugins/*.*"; // wrong
@import "../plugins/*.*"; // right

Ofc depending on your folder structure.
Took me a day x),
greets Dave

@Kcko
Copy link

Kcko commented Sep 3, 2014

Hey intenrs,

thx for help, but it not works. I'm getting sad ...

My structure

  • vendor
    • sass
      • layout
        • skelet
          • _header.scss
          • _footer.scss
      • _layout.scss (HOW DO I ENTER CORRECT IMPORT all files in folder skelet?)
    • _screen.scss (@import _layout.scss)

I have WIN 7 + nevest version of sass, compass and globbing

@hanspagel
Copy link

@intensr the double dot works for me (win 8), could anyone see if this works on mac too? don't want to f.. up my projects for mac users.

@import "../plugins/*.*";

EDIT: Sorry, it doesn't throw an error anymore, but it doesn't work. There is no file imported.

@intensr
Copy link

intensr commented Sep 6, 2014

It depends on your folder structure, in Kckos case id say its (maybe, didnt test it) the following and if not then something similar like that:

@import "../../skelet/*.*";
or
@import ".././skelet/*.*";

You have to go the way from the destinated file/folder to the import file (skelet/ -> screen.scss).
As Chris wrote in the docu

Globs are always relative to the current file.

Hope it helps otherwise I dont really know.

@Kcko
Copy link

Kcko commented Sep 8, 2014

I tried both ways .. not works ...
I'll have to import the files manually, damage

@pilavdzic
Copy link

This issue is still not fixed and it is preventing a lot of stuff from working correctly on Windows, for example the startersquad/ngseed angular seed project does not work for me on windows due to this error. I don't yet know enough about this issue to fix it but I hope someone else can!

@dougcassidy
Copy link

The recrusive dirs fix is working for me too.
dont work: @import 'partials/*';

works:
@import 'partials[slash][star star][slash][star]';

Win 7

@amitmtrn
Copy link

does anyone succeed in fixing this issue?
I tried

@import "components/*.*";

and I get this error

"Error: File to import not found or unreadable: components/_background-catalog.scss.\A Load paths:\A bower_components\A c:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/compass-core-1.1.0.alpha.3/stylesheets\A Compass::SpriteImporter\A Sass::Globbing::Importer\A on line 1 of app/styles/components/*.*\A from line 7 of app/styles/main.scss\A \A 1: @charset \"utf-8\";\A 2: @import \"compass\";\A 3: @import \"reset\";\A 4: @import \"global\";\A 5: @import \"icons\";\A 6: @import \"fonts\";"

@Dan503
Copy link

Dan503 commented Jan 25, 2015

I'm getting the same issue as amitmtrn

"Error: File to import not found or unreadable: ...

@Dan503
Copy link

Dan503 commented Feb 1, 2015

Hi, I've got a work around for this for anyone still having the issue.

https://github.com/DennisBecker/grunt-sass-globbing

Basically you create a file (an import map) that holds all your @imports and then let grunt fill it in with all the actual specific import paths for you. It's a little messier than if SASS just let you bulk import on it's own but it's guaranteed to work since sass will only be reading import paths to specific files, grunt is the one that reads the "sass/*.scss" stuff.

@maple-leaf
Copy link

still not working.
sass v3.4.11
compass v1.0.3
sass-globbing v1.1.1
win8 64

@LPGhatguy
Copy link

I'm getting this issue when there's only one file in the folder as well. Has there been any progress on the problem?

main.scss (Line 6: It's not clear which file to import for '@import "sections/*"'.
Candidates:
  sections/_header.scss
  sections/_header.scss
Please delete or rename all but one of these files.

@dougcassidy
Copy link

dont work: @import 'partials/*';

works:
@import 'partials/**/*';
note the 2 stars, then 1 star.

I use this on many sites.

@markentingh
Copy link

I cannot believe this issue is still open after THREE YEARS! This issue is a breaking issue and should have been fixed in January 2013, but here it is, end of February 2016, and I STILL can't compile a SASS project in Windows that works just fine in Linux. FIX THIS RIGHT NOW!!!!!

I am very disappointed to find out that in order for me to compile a SASS project on Windows, I have to change all * into **/* or *.* or some bullshit, which then needs to be CHANGED BACK to its original format before committing my changes so my team mates (who use Linux) can also compile the same SASS project on their machines. What a joke! I would rather use LESS than this crappy SASS globbing bullshit.

@LPGhatguy
Copy link

@markentingh Your team also has the option of moving to libsass (either sassc or node-sass) which has more options for import customization. It's right around on-par with Ruby Sass 3.4 now.

@markentingh
Copy link

that would require me to tell my team to rewrite their gulp files... honestly, I want this to be fixed for good, because the world needs this to be fixed. It's so frustrating walking into this problem over and over again, having to rewrite the SASS imports code for every project that uses SASS. It's just bullshit that no one has tackled this problem. Will no one claim responsibility?

@Dan503
Copy link

Dan503 commented Feb 26, 2016

Did you look into my post about a workaround?
https://github.com/DennisBecker/grunt-sass-globbing

It's messy but it works across all platforms.
I'm not sure if there is a gulp version out there though.

@markentingh
Copy link

Thank you for your help, @Dan503... It's a sad state of sass-globbing affairs, isn't it? It could so easily be fixed, and if only I could get to the heart of the problem in this open source project, I would fix it myself. This issue seems to be on the same level as ending world hunger (apparently). Guess I'll just have to install Virtual Box, Vagrant, and run Linux in Windows to accomplish what I'm trying to do...

Repository owner locked and limited conversation to collaborators Feb 26, 2016
@chriseppstein
Copy link
Owner

I would rather use LESS than this crappy SASS globbing bullshit.

Please do. Or maybe don't use globbing. Or fork it. Really, do anything you want, but yelling on my issue tracker to fix a thing that isn't even required for you to use, makes you a much bigger jerk than me for not maintaining a thing that I haven't used for coming on three years.

@chriseppstein
Copy link
Owner

Please test with 1.1.3 or greater and file a new issue if one still exists.

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