-
-
Notifications
You must be signed in to change notification settings - Fork 15
Issues when importing #1
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
Comments
@bradleygore Not sure if you resolved your issue. Just merged an improvement from @NathanWalker that addresses SCSS partials. It might help in your case. |
@toddanglin thanks for the plugin :) I'm new to NativeScript and I'm also coming across this issue with version 0.3.0 If I use an import statement like: Then I receive an error 'File to import not found or unreadable'. If I use the url syntax: The I receive the same 'Undefined variable: '$example...' error. I also receive an output to the console:
I looked at #5 and it suggests that a fix has been made but if it has I'm not seeing it - is there something in my code that I need to change? I'm used to prefixing my 'helpers' in sass with an underscore, but I get the same error even without the prefix. Cheers, Jake |
@jacobedawson Do you get the same error if the folder with your import is the same directory as your SASS file? That is...
My hunch is that this is related to directory traversal, so just want to confirm the import works correctly for you if we eliminate that variable. |
Hi @toddanglin - I think you're right about directory traversal being the core issue - Importing variables from my Sass folder is fine from the root component:
whereas
|
@jacobedawson Did a quick test, and I don't think you actually need to use the escape paths to reference your imports. The import will look for your files relative to the root app directory. SO...try this...
The import should find your |
@toddanglin oh man that's perfect :) Thanks a million, works like a charm :) |
This would have cost me hours of development time to debug. Thanks guys! For the thread of course. :) |
I'm using this plugin and SCSS stylesheets, and have a structure like this:
app/_variables.scss
app/someView/someComponent/someComponent.scss
When I'm in someComponent.scss, importing _variables.scss isn't working as expected. Here's how I've tried:
@import "../../_variables.scss";
and then based on anothers' suggestion tried@import url("../../_variables.scss");
With the first, it throws an exception saying _File to import not found or unreadable: ../../variables.scss
With the second approach, it seems to import correctly, but I can't access any of the actual variables. When I try to use them, I get this exception saying Undefined variable: "$darkBlue".
Is there something I'm totally missing?
The text was updated successfully, but these errors were encountered: