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 Modules doesn't error on missing composes #16075

Open
7 tasks done
privatenumber opened this issue Mar 2, 2024 · 1 comment · May be fixed by #16018
Open
7 tasks done

CSS Modules doesn't error on missing composes #16075

privatenumber opened this issue Mar 2, 2024 · 1 comment · May be fixed by #16018

Comments

@privatenumber
Copy link
Contributor

privatenumber commented Mar 2, 2024

Describe the bug

When composing a class from another file in CSS Modules, an error is not emitted if the class is not found.

This is akin to not erroring when trying to import a missing export from another JS file, and can lead to bugs.

This is fixed by #16018, but wanted to file it for tracking purposes since this seems like a pretty major issue that wasn't reported.

(Originally reported in privatenumber/vite-css-modules#2)

Reproduction

https://stackblitz.com/edit/vitejs-vite-w9i5ct?file=src%2Fstyle.module.css

Steps to reproduce

  1. In style.modules.css, observe that large-text is imported from ./utils.module.css
  2. In utils.module.css, observe that it's an empty file
  3. In the DOM, observe that undefined is passed in as a class:
    Screenshot 2024-03-02 at 5 09 02 PM

System Info

N/A

Used Package Manager

npm

Logs

No response

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant