Open christoph-fricke opened 2 months ago
Facing same issue, with css modules. I am unable to test any styles on ErrorBoundaries and have to shoot in the dark. Then building the project and starting the dev server is the only way I am able to check if the styles look decent
Reproduction
I am using vanilla-extract to style a Remix-Vite application. Recently I have noticed that the app sometimes loses it styles during development when an error boundary has been shown. I narrowed it down to only happen in combination with HMR and triggering error boundaries. Either while in an error boundary or even after leaving the boundary.
I am not sure if this is a problem in Remix or vanilla-extract. Since the error-boundary seems to be a part of the problem, I started with opening this issue in Remix.
Playground Link: Stackblitz
The playground app contains some links to navigate between routes as well as an route that throws a loader error. Clicking "Todo (Will Error)" will cause a error boundary to be rendered. All pages and the error boundary contain an element (Button component) that has been styled with vanilla-extract.
System Info
Used Package Manager
npm
Expected Behavior
The application remains styled during HMR while or after showing an error boundary.
Actual Behavior
The styled button element in the app loses its styles, which seem to only be recoverable by reloading the application. Since HMR is involved, this problem only occurs in development.