Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

typescript-plugin-css-modules not working with @use rule inside scss module

I have a SCSS module inside a Create React App project. I installed typescript-plugin-css-modules in order for Typescript to be able to "type" my module. I import it in my React component like this :

import s from "./core/layoutSidebar.module.scss";

Everything is working as expected as far as i don't import my variables into the module with the @use rule :

@use "style/helpers/variables";

If so, Typescript type the s imported module as an empty interface {} which makes my IDE throwing errors on my classNames.

Even if I only use the variables syntaxe (eg : $spacing-1) the same error happens again

like image 704
Alex Mongeot Avatar asked Jan 26 '26 09:01

Alex Mongeot


1 Answers

Thanks to Liam I figured out that the problem has already been reported as a bug on the repo.

like image 189
Alex Mongeot Avatar answered Jan 29 '26 00:01

Alex Mongeot



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!