Open Anahkiasen opened 10 years ago
I have had the same problem. Though it seemed to be specifically related to setting:
$icon-sprite-dimensions: true;
When set to false compass compiled without any trouble
I'm having the same error after upgrading to 1.0.0.alpha.19
.
Using the sprite-file($map, $sprite)
function.
Also seeing this problem. Oddly it just suddenly started happening. Not sure if it is related to sass 3.3.3 although this occurred about 4 hours after upgrading sass so I don't think so, unless some sort of caching was preventing it occurring initially.
The issue seems to be in how the sprite_file method generates a path to the original asset, as it end up generating invalid paths.
I have tried to modifying the function to fix the issue, but my low level of Ruby and under the hood Compass knowledge, meant I couldn't find a solution without breaking something else.
Looks like the same issues as raised in #1617
Related #1665
I'll look into it.
Ill look into this and #1665 tonight
Honestly, I cannot reproduce this unless I misconfigure my project by setting a *_path property to a relative url instead of an absolute path.
http://compass-style.org/help/tutorials/configuration-reference/
If someone can provide a properly configured project that has this issue please post the details.
When I upgrade to 1.0.0.alpha.19
have this issue on this project with the following config. No issue on 1.0.0.alpha.18
.
The error message:
Syntax error: different prefix: "/" and "test/img/sprites" for `sprite-file'
on line 14 of [...]/stylesheets/icons/_icon-generated.scss, in `icon-generated'
from line 70 of test/sass/test-icons.scss
Use --trace for backtrace.
I don't feel like doing something wrong in *_path config. Although I have to admit it's sometimes a bit confusing...
Thanks.
Edit:
I think I tried every possible combinations of config, and always get the error.
Checking the sprite_file
function code, there's been quite some changes between the 2 versions.
Related: #1659
@pascalduez
Try:
generated_images_dir = "img/sprites"
Try:
generated_images_dir = "img/sprites"
@chriseppstein Same issue with this setting...
Edit: even with a bare minimal settings I can't get ride of it:
css_dir = "test/css"
sass_dir = "test/sass"
images_dir = "test/img"
Basically, sprite-file
should only care about images_dir
or images_path
or I'm missing something ?
@pascalduez Can you make a zip (or tar.gz) file of a minimal compass project that has this problem and email it to chris@eppsteins.net?
Or a Github repo.
I fixed the issue by setting
project_path = File.expand_path('.')
as suggest by @brewster1134 in https://github.com/chriseppstein/compass/issues/1617#issuecomment-42152050
Investigating: I could not reproduce the error on a bare minimal project. So I tried to trace back the differences.
It seems to comes from the compiler used, sass instead of compass:
this produce the error:
bundle exec sass --watch --compass test/sass:test/css
while this works fine
bundle exec compass watch
Repository of test project: https://github.com/pascalduez/compass-1600
U P D A T E
The error can be reproduced with both sass
or compass
compiler. Seems to come from project_path
configuration:
# No error
css_dir = "test/css"
sass_dir = "test/sass"
images_dir = "test/img"
# Error
project_path = "test"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
New error, sprite_file
seems to pass a broken path to image_size
Errno::ENOENT on line ["31"] of [...]/sass_extensions/functions/image_size.rb: No such file or directory - [...]/compass-1600/test/img/../icons/social/png/facebook.png
css_dir = "test/css"
sass_dir = "test/sass"
images_dir = "test/img"
generated_images_dir = "test/img/sprites"
Repo updated.
I'm using Compass to compile and still got that error
I'm using Compass to compile and still got that error
Well yeah, that's what I just realized... I can get the error with compass compiler as well. Back to hunt... Will update previous comment.
project_path
is a path and needs to be absolute like all the other *_path
options. >_<
I don't love this config system, but it's how it works.
@chriseppstein You could internally make the paths absolute via File#expand_path/File#absolute_path, it wouldn't affect paths that are already absolute.
Alternatively raise an error on Pathname#relative? so people immediately see where the problem lies.
project_path
is a path and needs to be absolute like all the other*_path
options. >_< I don't love this config system, but it's how it works.
Well, a few points should be noted:
*_path
needs to be absolute1.0.0.alpha.19
Then there is the second issue:
as soon as I add generated_images_dir
(no project_path
)
https://github.com/pascalduez/compass-1600/blob/master/config.rb#L18-L22
Might be related to #1671
It does make sense to resolve project_path to an absolute value. The other *_path
settings should be an error if they are not set to an absolute value.
On
1.0.0.alpha.19
it seems I can't do this anymore :To generate the corresponding width and height of the sprites. Was this never intended to be in the public API ? I get this :
Removing the boolean fixes the problem. Works fine on
1.0.0.alpha.18
.