-
-
Notifications
You must be signed in to change notification settings - Fork 604
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 error with modules mode, composes and sass #131
Comments
Have similar issue with stylus. It seems to be that the stylus loader from the configuration file is not getting called. In my case transforming the styl file within the compose helped. composes: formInput from 'stylus!./elements.styl' In your case you have to call the sass loader instead of stylus. |
Oh, that's a great idea for a workaround - I hadn't even considered that - thanks! Obviously this is still a bug (or lack of feature?) somewhere along the line but this will certainly help move things along for me and my project very nicely! |
@l-urence your workaround worked for sass too, fyi - thank you so much 👍 |
I'm having this same problem using css-loader?modules along with sass-loader and resolve-url-loader. I'm having to write my |
@bkonkle We have the same issue and don't want to write lines like that either. I saw that u where working on a fix for it, how is it going? |
Unfortunately, I haven't made much progress. I'm not familiar with PostCSS, and that is what css-loader uses to enable the |
@l-urence doesn't seem to work for me on stylus:
common.styl:
My webpack config:
When I console.log
|
@geekyme I have to admit I'm not into this right now (haven't used it for quite a while). Maybe there is someone else to help out? |
any ideas @sokra ? |
I'm having a similar issue with Sass. Anything new here? |
I have the same problem ... who has the solution? |
I just discovered something last night that I'm not sure how I ever missed: https://github.com/webpack/css-loader#importing-and-chained-loaders In my case, importLoaders was set to "1", but it needed to be set to "2" so that the sass-loader is picked up by Webpack on @-imports. This fully resolved my issue with using sass and css-modules together. |
I'm using CssModules with
I've tried to change the My total loader config string is:
I looked through the compiled style code: exports.locals = {
"prompt": "prompt-modal__prompt___ySAyV " + __webpack_require__(699).locals["modal"] + "",
"prompt": "prompt-modal__prompt___ySAyV " + __webpack_require__(699).locals["modal"] + "",
"btn-prompt": "prompt-modal__btn-prompt___2k-dR",
"btnPrompt": "prompt-modal__btn-prompt___2k-dR",
"prompt-text": "prompt-modal__prompt-text___gQ1v5",
"promptText": "prompt-modal__prompt-text___gQ1v5"
}; |
Please try with the latest |
@michael-ciniawsky This is still not working. |
michael-ciniawsky Is there any update on this? 💪 |
I have a project in which I have a
Card
andCardContainer
component. The idea is that theCard
can be used in isolation if desired, or multiple cards can be used inside aCardContainer
which will arrange its cards in a grid and provide scrolling if necessary. In order to facilitate this, the container's CSS needs to modify the flex attributes of its children (addingflex 1 1 auto
for example).I'm using sass (via sass-loader) and each of my component sass files imports a
utils.scss
a couple of directories down, which works fine withoutcomposes
, but with it I am getting a file not found on theutils.scss
from the file being imported for composition.This is my directory structure:
My (simplified)
Card.scss
looks like this:My (again simplified)
CardContainer.scss
looks like this:The error I see is:
I don't fully understand how this all fits together but It seems to me that this mechanism is trying to resolve a js/jsx file rather than going through the sass pipeline. Does this make sense to you? It's resolving
./Card.scss
just fine - it's the secondary import that doesn't seem to be working.The text was updated successfully, but these errors were encountered: