You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 for class="" has 1lzbo part in the class name, but in the injected <style> tag it's yl1g2. When the math.random() is not used, the class names are correct. Both have 1u0g5 in their name.
The css property name that is using math.random() does not matter. The behaviour is consistent per file which contains math.random() while npm run dev.
This seems like an issue you should file with Vite. Sass has no part in generating your HTML. If you can find a case where a specific Sass input file is creating output you think is invalid, feel free to update this issue, but otherwise I don't think there's anything we can do to help you.
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
![Screenshot 2023-12-19 at 11 18 02 PM](https://private-user-images.githubusercontent.com/3314891/291716197-8e8afed0-f156-42de-9f6e-f39248e6e9bf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3Nzk3MDAsIm5iZiI6MTcyNTc3OTQwMCwicGF0aCI6Ii8zMzE0ODkxLzI5MTcxNjE5Ny04ZThhZmVkMC1mMTU2LTQyZGUtOWY2ZS1mMzkyNDhlNmU5YmYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDhUMDcxMDAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTA0YmZhOWRhOTM3ZmJjMzk4ZGE2OWM5ZjI4NjhjZGEzZTk5MjRlMGM4MTllOGFmNzVlZmVjNTU4NTVkNWM1MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.7X1maXPOsJA2G2-6-Ik_3WCI2sSJsnOofOb31K5xmRI)
math.random()
Without the
![Screenshot 2023-12-19 at 11 17 39 PM](https://private-user-images.githubusercontent.com/3314891/291716264-cc3c500c-b564-438e-bec0-ab50e3c50683.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3Nzk3MDAsIm5iZiI6MTcyNTc3OTQwMCwicGF0aCI6Ii8zMzE0ODkxLzI5MTcxNjI2NC1jYzNjNTAwYy1iNTY0LTQzOGUtYmVjMC1hYjUwZTNjNTA2ODMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDhUMDcxMDAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTZmMTZkMjA4NjlmOWQ3Mzg2NmU5OTRlN2JhZDg3NTNkOGI2YTcyNDZiN2QyM2IyNjU1ZmJiMGFjOTAyOTc0YiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.x29fQNgPf4ME-pEV7E6EuYDjNLYJw_Q3hgVc2DWhiGw)
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()
.The text was updated successfully, but these errors were encountered: