How to use scss modules in Next.js server components

177 Views Asked by At

I am trying to implement server components in my Next.js app. I'm using scss modules for styling.

A typical component in my project looks like this:

//MyComponent.client.jsx

import s from './MyComponent.module.scss';

export const MyComponent = ({ props }) => {
return <div id={ s.wrapper }>{ props.stuff }</div>
};

When I change this to: MyComponent.server.jsx

Styling ceases to work, and I don't get any errors.

How can I maintain this functionality in a server component?

0

There are 0 best solutions below