Replies: 2 comments 4 replies
-
I tried to debug further. Found the root case of issue, but I still wasn't able to reproduce it in small project. In my big project postcss compiles everything 3 times at startup, i.e. it runs panda postcss async task 3 times simultaneously. I don't know what causes this behavior, plugin, config, dependency conflict? Because builder instance is global, i.e. I can create PR to resolve this race condition, but since I'm unable to isolate it, you will unable to check if it works, unless using my big project in its current state and to hit this race condition, because it doesn't occur every time. Should I proceed? |
Beta Was this translation helpful? Give feedback.
-
Created this PR to resolve issue: #2919 For those who stumble the same issue, you can use the following workaround before PR is merged:
import pandacss from '@pandacss/dev/postcss';
import autoprefixer from 'autoprefixer';
let pandacssGuard;
const pandacssWorkaround = (...options) => {
const panda = pandacss(...options);
return {
postcssPlugin: 'pandacss-workaround',
plugins: [
async function (...args) {
for (;;) {
if (!pandacssGuard) break;
await pandacssGuard;
}
pandacssGuard = panda.plugins[0](...args).finally(() => {
pandacssGuard = undefined;
});
return pandacssGuard;
},
],
};
};
export default {
plugins: [autoprefixer(), pandacssWorkaround()],
}; |
Beta Was this translation helpful? Give feedback.
-
Description
When vite HMR is triggered - all panda generated styles disappear from stylesheet, except one from changed file. Only full server restart helps, but when file is changed again - styles disappear again.
Link to Reproduction
??
Steps to reproduce
I cannot reliably reproduce this issue. I tried creating minimal application - but it works fine there. It can be reproduced only inside my (quite big) application. It also sometimes works (after many restarts, didn't notice what change fixes issue), possibly it is related to my setup.
JS Framework
React (TS)
Panda CSS Version
0.46.1
Browser
No response
Operating System
Additional Information
I tried to track down issue by debugging pandacss sources at startup and after triggering HMR. As far as I understood scenario is the following:
Builder
class accepts list of changed filesextractFile
function is triggered for every file, and this function produces static css for ts filesmeta.isUnchanged
as true, and they are skippedBeta Was this translation helpful? Give feedback.
All reactions