NativeScript/nativescript-dev-sass

If you import sass file into sass file an error will be thrown

Closed this issue · 4 comments

  1. import sas file in sass file (e.g."./1")
  2. Run "tns run ios"
    Actual: An error is thrown "Error: It's not clear which file to import for '@import "1"'.
    Candidates:
    1.scss
    1.css
    Please delete or rename all but one of these files.
    on line 5 of app/app.scss
    » @import './1';"
    Expected: To be able to import sass file in sass file

Hi @vhristov5555 ,

Which version of NativeScript are you using? Please, run tns info and paste the result here. Thanks!

Hi @radeva ,
I have just tested with {N} 3.4.0 and the result is the same.

Hi @vhristov5555 ,

This is caused by a limitation of the node-sass lib which is used under the hood of this plugin. There is an open issue long time ago discussing the topic and it looks like this is an expected behavior.

I would recommend in this case to use partial scss files which are basically named _somename.scss and imported as @import somename. No corresponding css files is created for partials so you won't experience the mentioned issue.

In case you have a reason not to use partials, other option is to use the file extension when importing the the file i.e. @import './1.scss'.

Let me know if this helps.

I was able to use it with "@import './1.scss'"

Thanks.