question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on SASS Partials in 1.x

See original GitHub issue

Hi @jhnns,

I am not a node-sass expert by any means, and so I cannot comment on exactly what the desired end result should be, but I make extensive use of SASS partials in my code and the handling of them seems to have changed when moving from 0.x to 1.x.

For example: If I have file _my-partial.scss, I would expect to (as working in 0.x) be able to reference it in my main SCSS file as @import "my-partial".

In 1.x, you have to explicitly write the underscore, but as I understand it, the underscore is what signifies to SASS that it is indeed a partial.

More info: http://sass-lang.com/guide

Many thanks for your hard work on sass-loader!

James

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Feb 13, 2018

webpack causing more problem than it solves. Why this would not work i don’t get it.

1reaction
confikscommented, Mar 24, 2015

I ran into the same issue today when upgrading to 1.0.0. All my import statements of partials yielded ‘file to import not found’ errors. If it is intentional that partials should now be referenced with an underscore, a note should be added to the readme.

My setup is roughly: create a webpack config with config.entry = ['./entry.js']. In entry.js use require('scss/app'). In scss/app.scss use @import 'somepartial';. Previously this would have loaded the file scss/_somepartial.scss, but it now fails with an error. @import './somepartial'; fails as well. Using @import '_somepartial'; works however.

Related question: Now issue #39 has been implemented, what is really the difference between a partial import and a regular file import?

Read more comments on GitHub >

github_iconTop Results From Across the Web

SASS global variables not being passed to partials
Basically I have a structure that used to work perfectly in 3.0.x and now it breaks with undefined variable ...
Read more >
Importing Sass Partials - LearnHowToProgram.com
This lesson will explore how we can organize and modularize our styles by creating multiple Sass files, and importing into one another as...
Read more >
Debugging Errors in Sass (How To) | CSS to Sass - Treehouse
In this video, we'll look at common errors that may happen when using Sass features like variables, ... it's happening in our containers.scss...
Read more >
mixin and @include - Sass
Mixins allow you to define styles that can be re-used throughout your stylesheet. They make it easy to avoid using non-semantic classes like...
Read more >
Sass error when not using Gulp: "File to import not found or ...
Change detected at 13:18:15 to: styles.scss error styles.scss (Line 20 ... Done installing documentation for zen-grids after 0 seconds 1 gem ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found