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

Relative imports fail when include path is a relative path outside working directory #1846

Closed
asottile opened this issue Jan 10, 2016 · 5 comments
Assignees
Milestone

Comments

@asottile
Copy link
Member

This is from sass/libsass-python#114 (comment)

Here's a (relatively) small reproducible case:

bower install foundation
echo "@import 'foundation';" > test.scss
# This works
node-sass --include-path bower_components/foundation/scss test.scss test.css
ls test.css
# Now let's show the bug
mkdir projectdir
cd projectdir
echo "@import 'foundation';" > test.scss
# This fails
node-sass --include-path ../bower_components/foundation/scss test.scss test.css

Output:

$ bower install foundation
bower cached        git://github.com/zurb/bower-foundation.git#5.5.3
bower validate      5.5.3 against git://github.com/zurb/bower-foundation.git#*
bower cached        git://github.com/jquery/jquery-dist.git#2.2.0
bower validate      2.2.0 against git://github.com/jquery/jquery-dist.git#>= 2.1.0
bower cached        git://github.com/ftlabs/fastclick.git#1.0.6
bower validate      1.0.6 against git://github.com/ftlabs/fastclick.git#>=0.6.11
bower cached        git://github.com/carhartl/jquery-cookie.git#1.4.1
bower validate      1.4.1 against git://github.com/carhartl/jquery-cookie.git#~1.4.0
bower cached        git://github.com/mathiasbynens/jquery-placeholder.git#2.0.9
bower validate      2.0.9 against git://github.com/mathiasbynens/jquery-placeholder.git#~2.0.7
bower cached        git://github.com/Modernizr/Modernizr.git#2.8.3
bower validate      2.8.3 against git://github.com/Modernizr/Modernizr.git#2.8.3
bower install       foundation#5.5.3
bower install       jquery#2.2.0
bower install       jquery-placeholder#2.0.9
bower install       fastclick#1.0.6
bower install       jquery.cookie#1.4.1
bower install       modernizr#2.8.3

foundation#5.5.3 bower_components/foundation
├── fastclick#1.0.6
├── jquery#2.2.0
├── jquery-placeholder#2.0.9
├── jquery.cookie#1.4.1
└── modernizr#2.8.3

jquery#2.2.0 bower_components/jquery

jquery-placeholder#2.0.9 bower_components/jquery-placeholder
└── jquery#2.2.0

fastclick#1.0.6 bower_components/fastclick

jquery.cookie#1.4.1 bower_components/jquery.cookie
└── jquery#2.2.0

modernizr#2.8.3 bower_components/modernizr
$ echo "@import 'foundation';" > test.scss
$ # This works
$ node-sass --include-path bower_components/foundation/scss test.scss test.css
Rendering Complete, saving .css file...
Wrote CSS to /tmp/foo/test.css
$ ls test.css
test.css
$ # Now let's show the bug
$ mkdir projectdir
$ cd projectdir
$ echo "@import 'foundation';" > test.scss
$ # This fails
$ node-sass --include-path ../bower_components/foundation/scss test.scss test.css
{
  "formatted": "Error: File to import not found or unreadable: global\n       Parent style sheet: ../bower_components/foundation/scss/foundation/components/_grid.scss\n        on line 5 of ../bower_components/foundation/scss/foundation/components/_grid.scss\n>> @import 'global';\n   ^\n",
  "message": "File to import not found or unreadable: global\nParent style sheet: ../bower_components/foundation/scss/foundation/components/_grid.scss",
  "column": 1,
  "line": 5,
  "file": "../bower_components/foundation/scss/foundation/components/_grid.scss",
  "status": 1
}

I've also confirmed the bug with the python bindings as well, leading me to assume this is a bug with libsass itself.

@jkrehm
Copy link

jkrehm commented Jan 13, 2016

I think this and #1750 are the same issue.

@mgreter
Copy link
Contributor

mgreter commented Jan 13, 2016

Was this against master? Cannot find any indication which libsass version?

@asottile
Copy link
Member Author

This is against 3.3.2

@mgreter
Copy link
Contributor

mgreter commented Jan 13, 2016

Might be fixed then, can you try latest master?

@asottile
Copy link
Member Author

Fixed in master, thanks!

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

No branches or pull requests

3 participants