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

sass module stylings not applied on client components in nextjs13 #42267

Closed
1 task done
outdoteth opened this issue Oct 31, 2022 · 6 comments
Closed
1 task done

sass module stylings not applied on client components in nextjs13 #42267

outdoteth opened this issue Oct 31, 2022 · 6 comments
Labels
bug Issue was opened via the bug report template.

Comments

@outdoteth
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Binaries:
  Node: 16.16.0
  npm: 8.11.0
  Yarn: 1.22.19
  pnpm: N/A
Relevant packages:
  next: 13.0.0
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When I convert my server component to a client component, the styles fail to render.

The following example works:

import "MyComponent.module.scss";

export const MyComponent = () => {
   // stuff
}

But this example fails to render the styles:

"use client";

import "MyComponent.module.scss";

export const MyComponent = () => {
   // stuff
}

Expected Behavior

The styles should be applied on client components

Link to reproduction

closed source

To Reproduce

see above steps^

@outdoteth outdoteth added the bug Issue was opened via the bug report template. label Oct 31, 2022
@jmikrut
Copy link
Contributor

jmikrut commented Oct 31, 2022

@outdoteth this is a duplicate of #41791.

Doing some testing myself, I've found that the problem is fixed in dev mode, but after building and serving (even having deployed to Vercel) a lot of my styles are still missing.

Seems like there's still some work to be done here?

@shuding
Copy link
Member

shuding commented Nov 1, 2022

Can you provide a more detailed reproduction, like a temporary repository?

@oelbaga
Copy link

oelbaga commented Nov 1, 2022

I had this issue all day and I couldn't figure what was going on but I updated 13.0.0 to 13.0.1 canary and the issue was fixed. I believe 13.01 was released just a few hours ago.

@outdoteth
Copy link
Author

This works after i bumped the version to 13.0.01.

From the release notes:

Fix css modules imports in client components: #42077

@jmikrut
Copy link
Contributor

jmikrut commented Nov 1, 2022

Hey @shuding — thanks for the follow-up. Yes, we are building the new Payload website in public, and it's all open-source.

https://github.com/payloadcms/website

You'll see on https://stage.payloadcms.com that lots of the CSS module stylesheets are missing, but developing locally, they're all there. The site is certainly 100% in progress right now so things are unfinished everywhere but this shows the reproduction steps.

I really appreciate your help here!

Edit: I think this was fixed recently, like, today. Because now when we deploy, all the styles are loaded properly! THANK YOU

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

4 participants