privatenumber / vite-css-modules

Vite plugin for correct CSS Modules behavior
MIT License
53 stars 3 forks source link

More readable error when trying to compose class that doesn't exist #2

Closed axelboc closed 9 months ago

axelboc commented 9 months ago

Feature request

Improve error message when trying to compose a class that doesn't exist in the target CSS module.

Motivations

Thank you so much for looking into these CSS Modules issues! I'm still testing but the first problem I encountered was the following error:

Internal server error: Cannot read properties of undefined (reading 'exportAs')

It occurred on a composes declaration in which the class I was trying to compose did not exist in the target CSS module. This kind of issue was not reported previously, so it's such a nice win that it is now!!

Since the error message is a bit cryptic, would it be possible to rethrow a clearer error message?

Alternatives

No response

Additional context

No response

Contributions

privatenumber commented 9 months ago

Thanks for reporting this.

Since this bug wasn't reported/tracked in Vite, I filed it here: https://github.com/vitejs/vite/issues/16075

privatenumber commented 9 months ago

:tada: This issue has been resolved in version 1.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: