Skip to content
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

CSS not being compiled in non-pages directory #3993

Closed
1 task done
fandy opened this issue Mar 12, 2018 · 4 comments
Closed
1 task done

CSS not being compiled in non-pages directory #3993

fandy opened this issue Mar 12, 2018 · 4 comments

Comments

@fandy
Copy link

fandy commented Mar 12, 2018

I currently have my project setup with Emotion but have tried Sass modules as well. It compiles styles in the pages dir, but not elsewhere. Is this a Next.js issue, or is there something wrong with the way I set it up? When I tried with Sass modules I encountered the same problem, where the styles would exist if the component was in pages but not in another root dir.

Styles exist in pages

image

Styles do not exist in components

image

The weird thing is, the className is there but just not the styles for it.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Has styles in the Header className

Current Behavior

Header className is being referenced but contains no styles. However, the styles in pages does.

@fandy fandy changed the title Emotion not working in non-pages directory CSS not being compiled in non-pages directory Mar 12, 2018
@pklada
Copy link

pklada commented Mar 15, 2018

Your screenshots appear to be the same.

But, I'm getting a similar behavior when using css modules.

config:
image

test style (in styles.scss)
image

markup
image

result
image

You can see the class is generated, but no styles are actually being applied (color, background-color)

Is this a known issue?

@timneutkens
Copy link
Member

@pklada try upgrading to next@canary and installing the latest next-css. Should be fixed.

@pklada
Copy link

pklada commented Mar 15, 2018

@timneutkens will do. thanks for the quick reply!

@fandy
Copy link
Author

fandy commented Mar 15, 2018

Upgrading to next@canary fixed it for me. 🙌

@fandy fandy closed this as completed Mar 15, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Mar 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants