Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


source-map option causes warn_about_public_url cause by mixing up slash and backslash in call to relative_path_from #1135

pasdut opened this Issue · 2 comments

2 participants


SASS 3.3.0.rc.5 - Windows 8.1 x64

I'm calling SASS from within gulp-sass and I get the warn_about_public_url.

I confirm gulp-sass is sending correct filenames (the spawn is :sass C:\Users\pascal\AppData\Local\Temp\46f2af77-e238-473f-a0d6-ff6b97cc09c1\main.scss C:\Users\pascal\AppData\Local\Temp\46f2af77-e238-473f-a0d6-ff6b97cc09c1\main.css --load-path C:\Pascal Documenten\projecten\Specialleke\site-dev.002\styles --sourcemap) But if I print the values from the variables dest_directory and base_directory infrom relative_path_from(pathname.rb) then I see that sometimes the '\' is replaced by a '/'.

I quick fixed this by following patch on relative_path, but I guess this is a sass issue (probably in filesystem.rb?)

def relative_path_from(base_directory)
  #pascal patched :         
  #dest_directory = self.cleanpath.to_s
  #base_directory = base_directory.cleanpath.to_s
  # hardcoded fix only for windows
  dest_directory = self.cleanpath.to_s.capitalize!.gsub("/", "\\")
  base_directory = base_directory.cleanpath.to_s.capitalize!.gsub("/", "\\")

This is a debug log of one call to SASS to compile with source_map

[relative_path_from patch]base :C:\users/pascal/appdata/local/temp/33d81f64-28a8-41f6-b3c1-23074ec13efd
[relative_path_from patch]dest: C:\users/pascal/appdata/local/temp/33d81f64-28a8-41f6-b3c1-23074ec13efd/main.css

Here below you see that the second time the relative_path_from is called, the base has a backslash after "C:" while destination has a slash after "C:"

[relative_path_from patch]base :C:\users/pascal/appdata/local/temp/33d81f64-28a8-41f6-b3c1-23074ec13efd
[relative_path_from patch]dest: C:/users/pascal/appdata/local/temp/33d81f64-28a8-41f6-b3c1-23074ec13efd/main.scss

Same goes for the third call to relative_path_from

[relative_path_from patch]base :C:\users/pascal/appdata/local/temp/33d81f64-28a8-41f6-b3c1-23074ec13efd
[relative_path_from patch]dest: C:/users/pascal/appdata/local/temp/33d81f64-28a8-41f6-b3c1-23074ec13efd/main.scss
@nex3 nex3 added the Bug label
@nex3 nex3 added this to the 3.3 milestone

Can you provide a simple case that I can reproduce locally? In particular, one of more Sass files that produce an unexpected warning, and a command-line invocation of the sass executable that causes that warning to be emitted.

@nex3 nex3 referenced this issue from a commit
@nex3 nex3 Avoid Pathname canonicalization errors on Windows.
Pathname doesn't canonicalize Windows directory separators, which was
causing #relative_path_from to fail. We now do this canonicalization

Closes #1135
@nex3 nex3 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.