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

@import path resolution #5

Closed
starteleport opened this issue Mar 2, 2016 · 7 comments
Closed

@import path resolution #5

starteleport opened this issue Mar 2, 2016 · 7 comments

Comments

@starteleport
Copy link

I'm not sure whether this is the right place to post this, please redirect me if appropriate.

I've used BundleTransformer prior to version where it used libsass, and everything went OK. However, since I upgraded to LibSassHost 0.4.3-based version, it broke. I no longer can compile [
content/styles/components/popup.scss from this archive. I get "Exception in native code"

My investigations show that this is due to difference in @import path resolution. Parent file in my example is importing a mixin, that has another import in it. The problem is that import from mixin is resolved relatively to parent file, not relatively to mixin. The ticket in libSass is seems to have been closed and LibSassHost 0.4.3 seems to have added support for libSass 3.3.3.

@Taritsyn
Copy link
Owner

Taritsyn commented Mar 3, 2016

Hello, Nikolay!

I checked this error by using the node-sass:

C:\Projects\TestBundleTransformer\TestBundleTransformer\Content\Styles\components>node-sass -v
node-sass       3.5.0-beta.1    (Wrapper)       [JavaScript]
libsass         3.3.3   (Sass Compiler) [C/C++]

C:\Projects\TestBundleTransformer\TestBundleTransformer\Content\Styles\components>node-sass popup.scss
{
  "formatted": "Error: only UTF-8 documents are currently supported; your document appears to be UTF-16 (little endian)\n        on line 1 of popup.scss\n>> ��@\n   ^\n",
  "message": "only UTF-8 documents are currently supported; your document appears to be UTF-16 (little endian)",
  "column": 1,
  "line": 1,
  "file": "C:/Projects/TestBundleTransformer/TestBundleTransformer/Content/Styles/components/popup.scss",
  "status": 1
}

@starteleport
Copy link
Author

Andrey!

Sorry, my bad, been working late hours 😃

Maybe you could arrange separate error message for this? Nothing but your words suggested that it doesn't support UTF-16.

I've corrected encoding problems now, and here are original sass files that fail with LibSassHost, and working files with hacked include paths. I've double-checked that each of these file sets are compiled well by node-sass.

@starteleport
Copy link
Author

BTW, my node-sass version is:

node-sass       3.4.2   (Wrapper)       [JavaScript]
libsass         3.3.2   (Sass Compiler) [C/C++]

@Taritsyn
Copy link
Owner

Taritsyn commented Mar 3, 2016

npm install -g node-sass@beta

@Taritsyn
Copy link
Owner

Taritsyn commented Mar 3, 2016

here are original sass files that fail with LibSassHost, and working files with hacked include paths.

I decide this issue.

@spotscarta
Copy link

Hi,

I am having a similar issue. The attached ZIP shows an example of the problem:
ProblemExample.zip

When using ruby sass (v3.4.21) to compile Features/BaseHtmlLayout/BaseHtmlLayout.scss the compilation is successful. When LibSassHost is used (via BundleTransformer.SassAndScss) it fails with this error message:

Message: File to import not found or unreadable: ../../../Shared/_Mixins.scss
Parent style sheet: /ProblemExample/Components/ListingStyles/SquareBlockList/_SquareBlockList.scss
File: /ProblemExample/Components/ListingStyles/SquareBlockList/_SquareBlockList.scss
Line number: 1
Column number: 1
Source fragment:

Line 1: @import "../../../Shared/_Mixins.scss";

Please let me know if you need any more info.

@Taritsyn
Copy link
Owner

Taritsyn commented Mar 3, 2016

In Bundle Transformer 1.9.92 Beta 2 fixed this error.

@Taritsyn Taritsyn closed this as completed Mar 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants