-
Notifications
You must be signed in to change notification settings - Fork 130
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
PostCSS css-compile-variables
is flakey with vite@2.9.0
+
#722
Comments
I've narrowed it down to to our appended I've confirmed that To note: It doesn't appear to be another Windows path backslash problem like #721 (comment) even though there are a few more cases in our codebase with that same regex. Some code paths seem to get normalized forward slash paths anyway. |
So the following check in our PostCSS plugin to skip the And the reason it works sometimes (flakey), depends on the order that the files are processed. We also have the variable maps declared in the plugin instance scope which are shared across all of the files processed. So if we process one of the We should move the map variables inside the file processing ( Then we also need to address a way to skip and detect |
I've traced the problem to Vite at This behavior regressed or changed in |
css-compile-variables
is flakey on Windowscss-compile-variables
is flakey with vite@2.9.0
+
Asked in vitejs/vite#7822 whether this |
@MidhunSureshR Any concern/interest about our custom PostCSS plugins having a bunch of plugin instance-level variables which are shared across all files being processed? Is this by design? It feels like ideally, we don't want this to be the case. |
This wasn't really by design. I just didn't want to pass the maps around and didn't really see an immediate issue with the approach. We can definitely bring the scope down for those variables 👍 . |
Fix #722 Updating Vite to includes fixes from vitejs/vite#7822 -> vitejs/vite#7827
|
Hey @MidhunSureshR could you still have a look to move the scope of those variables down? I think it's a good thing to do regardless of it not being an immediate problem anymore now. |
Created #745 to track this separately ⏩ |
With
vite@2.9.1
installed, I'm noticing that sometimesyarn build:sdk
fails with the following error related toscripts/postcss/css-compile-variables.js
. I'm able to reproduce on the latestmaster
with the changes from #721 to get around the first error noted in that linked PR.I'm only able to reproduce on Windows 10. I tried runningwhile yarn build:sdk; do :; done
on macOS to repeat until failure but never saw any failure there.Failing run ❌:
Getting some more debugging info on which variable is failing
Added some extra logging to
scripts/postcss/css-compile-variables.js#L78
, we can see what declaration it's failing on.For some reason,
background-color-secondary
isn't being populated inbaseVariables
:For reference, here is how it looks when it works successfully:
Successful run
Dev notes
while yarn build:sdk; do :; done
bash -c "while bash scripts/sdk/build.sh; do :; done"
Platform details
Windows 10 using Cmder. It spawns a
Git Bash
window to run thebuild.sh
script.The text was updated successfully, but these errors were encountered: