Node-sass: IndentedSyntax not working together with importer

Created on 3 Oct 2015  Â·  12Comments  Â·  Source: sass/node-sass

The indentedSyntax option and the custom importer functionality don't play well together. If I set indentedsyntax to true, it works as long as I don't have any imports. If I have an import and I return a file with indented syntax, it tries to parse this as scss instead of sass.

Here's a very minimal reproduction of the issue: https://github.com/sebakerckhof/node-sass-import-test

Btw, is it valid in sass to import .sass files in .scss files or vice-versa? If so, then the importer should be able to specify for each file if it's indented syntax or not... Or the sass compiler should be smart enough to infer this from the content of a file instead of solely the filename...

API - Custom Importers Bug - Confirmed External - LibSass indented syntax

Most helpful comment

Any good news with this issue?

All 12 comments

Thanks for the report @sebakerckhof. Thanks heaps for the reproduction repo, that'll make our lives infinitely easier.

is it valid in sass to import .sass files in .scss files or vice-versa

Yes. The file extension should be used to differentiate which parser should be used.

the sass compiler should be smart enough to infer this from the content of a file instead of solely the filename

True. This is something has only very recently surfaced because so few people still used the old syntax.


There has been some discussion on how to best handle this since we will not always have the filename available i.e. importers which return data.

@chriseppstein could you please elaborate on how this is handled with Ruby Sass?

Since this is external (in libsass). Do I need to make an issue there?
Also, would it be simple enough to let us just hint what syntax is used. E.g return

{
 indentedSyntax: true
 contents: result.data
}

from an Importer.

Or if both the contents and filename are returned, don't read the file, but use the contents and select the right syntax based on the extension of the filename ?

So for importing *.sass files we have to wait a patch.
You guys can covert all sass to scss in one command

sass-convert -R -F sass -T scss .

+1

+1

+1

Still having this problem in 3.4.1. Had to downgrade to fourseven:scss@=3.2.0.

Has there been any news regarding this?

Any good news with this issue?

@xzyfer in ruby sass, the importer specifies which syntax the content string being returned is in.

Ruby sass ten times slower :(

On Fri, Jul 1, 2016, 10:45 PM Chris Eppstein [email protected]
wrote:

@xzyfer https://github.com/xzyfer in ruby sass, the importer specifies
which syntax the content string being returned is in.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/sass/node-sass/issues/1192#issuecomment-230032629,
or mute the thread
https://github.com/notifications/unsubscribe/AAid-ZFmnQX7ge1qVr6Tjrl3npWK2MEYks5qRW5egaJpZM4GIZnd
.

I'm running into other libraries that have dependencies on the 3.4 branch and can't downgrade (not sure why). Is this being actively worked on?

Any chance this will get resolved?

I've created a bug with libsass as this is blocked there => https://github.com/sass/libsass/issues/2812

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bgolubovic picture bgolubovic  Â·  3Comments

ruchern-chong picture ruchern-chong  Â·  3Comments

nagyfej picture nagyfej  Â·  3Comments

samayo picture samayo  Â·  3Comments

liuyuqiang picture liuyuqiang  Â·  3Comments