-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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 modules]composed scss file is treated as css #10340
Comments
@sapphi-red Could you tell us about the current status? I think we need to apply preprocessor to composed file and pass to vite/packages/vite/src/node/plugins/css.ts Line 932 in 060cd66
|
I don't have plans to work on this issue at this time. |
I did some research. |
FWIW the same issue arises from |
@Thiry1 |
@sapphi-red |
Does anyone know which version introduced this bug? Or has it always been around? |
@MorayM I've tried yesterday, 20230401. it might be every version after code analyzing |
@chaishi interesting, do you know which version introduced code analysing off the top of your head? |
@chaishi interesting, do you know which version introduced code analysing off the top of your head? I'll roll back to that and see what happens. |
@sapphi-red Do you have any plan to fix this when you switch to lightning css in vite 5? |
Having the same issue. Also, when using the "Exporting values variables" feature like this: // A.module.scss
.shared {
// comment (causes error)
color: red;
}
// B.module.scss
@value shared from './A.module.scss';
.shared {
background: red;
} the same error will show up. @sapphi-red so maybe we can move this PR forward? Thanks alot!
|
I just didn't have time to check your PR. |
Just wanted to chime in to encourage anyone who's working on this. My company uses Sass + modules and we've come up against this issue recently (using Vite for the first time with Storybook). It'd be very helpful if something was done here so that we don't have to alter our workflow too much! |
@BrendanBerkley if there are some folks in your company with JS knowledge, it may be more effective to put some resources to dig into Vite's code base and help review the PR or propose a solution so you don't need to alter your workflow. |
@patak-dev There's already a PR, seemed like the issue isn't finding a solution but finding time to review it. Is it beneficial for someone who's never looked at your code before to kick the tires on a PR? I'm not sure how I'd be helpful. If I'm able to review it would it then be accepted? Does this project do bounties? I could try to drum up some support for that if that would help. |
Yes, I think it is always beneficial to dive into the code. You'll learn a lot during the process, so even if you don't end up creating a PR, you can easily justify the time. And you'll be better prepared to help next time. You'll also be able to give better information about the issue to other contributors. About reviewing the PR, we can't assure you it will be merged after your review. The solution needed may end up being different but your review could help the PR move forward. Exploring the possible solutions helps.
We don't do bounties. GitHub sponsors is enabled though, and you could add Vite as part of your Company OSS funding strategy if you think that is a good idea. |
I did a little local testing of the PR above. |
I've implemented a fix via https://github.com/privatenumber/vite-css-modules (which is getting integrated into Vite core via #16018). Testing and feedback will be appreciated! |
Describe the bug
When compose from scss, scss treats as css.
// comment
will throwsCssSyntaxError:foo.module.scss:2:8: Unknown word You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser
Reproduction
https://github.com/Thiry1/vite-bug-reprodocution
System Info
Used Package Manager
yarn
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: