Using math.random()
in css module leads to a wrongly generated class names
#4238
Replies: 1 comment
-
This sounds like a problem with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I used
create-preact
to initialise my app.It uses
vite v4.3.2
andsass v1.69.5
.I have a scss module with a code that contains
math.random()
.And because of the
math.random()
as a result the names that are assigned to the html elements are not that are being generated and loaded in the stylesheet.With the
math.random()
Without the
math.random()
For clarity. When the
math.random()
is used the generated class name that is used forclass=""
has1lzbo
part in the class name, but in the injected <style> tag it'syl1g2
. When themath.random()
is not used, the class names are correct. Both have1u0g5
in their name.The css property name that is using
math.random()
does not matter. The behaviour is consistent per file which containsmath.random()
whilenpm run dev
.I tried reproducing it, but no success. The minimal version works correctly.
https://stackblitz.com/edit/vitejs-vite-dtieff?file=style.module.scss
Haven't yet tried upgrading
vite
to the latest version.What could be wrong? Which part could be failing here? And how can I try to fix this? Apart from not using
math.random()
.Beta Was this translation helpful? Give feedback.
All reactions