Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Styles not being updated at runtime with cssgen --watch #3136

Open
1 of 3 tasks
danLDev opened this issue Feb 11, 2025 · 3 comments
Open
1 of 3 tasks

Styles not being updated at runtime with cssgen --watch #3136

danLDev opened this issue Feb 11, 2025 · 3 comments

Comments

@danLDev
Copy link

danLDev commented Feb 11, 2025

Description

Context

We've been using panda for a while in a poly-repo setup, and everything has been great. However we've recently moved over to monorepos and started encountering some issues during watch mode.

Our current setup is a little complex:

Packages Monorepo

@org/tokens: Exports a panda preset
@org/ui: Consumes the preset, exports components and a panda build manifest with panda ship

Platform Monorepo

@org/styled-system: Consumes the panda preset from @org/tokens, exposes panda functions via import map.
@org/<module>: Multiple modules consume @org/styled-system, also export a build manifest
@org/platform: Consumes build manifests from modules, via the includes config, also uses @org/styled-system to create platform specific components.

Everything in the above setup works absolutely fine on build, manifests are built in the sub-packages, and the output is as expected.

Problem

The issue arises when we start to use watch mode and HMR. When making a change in @org/<module>, I can see the build manifest is generated fine, and the css at @org/platform styled-system/styles.css is updated to reflect this. But the styles aren't visible in the browser without re-starting the development server, which leads me to believe it's related to postcss.

Link to Reproduction

https://github.com/danLDev/panda-repro

Steps to reproduce

  1. From the root, run yarn dev
  2. In browser, you should see build time styles (pink button)
  3. Inside packages/ui/src/button update the color
  4. Note packages/ui/dist/panda.buildinfo.json updated properlt
  5. Note apps/app/styled-system/styles.css updated to contain new class
  6. In browser, css doesn't seem to be applied.

JS Framework

React

Panda CSS Version

0.52.0

Browser

Arc/Chrome

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

@jstcki
Copy link

jstcki commented Feb 11, 2025

I wanted to report something similar, I believe this happened in the 0.52 update. Changes to files don't trigger a rebuild anymore, with 0.51.1 it works fine. This may to do with the change that chokidar v4 doesn't support globs anymore: https://github.com/paulmillr/chokidar?tab=readme-ov-file#upgrading

@SlexAxton
Copy link

I'm also experiencing a regression in file watching after moving from 0.46.0 to 0.53.0 with no other changes in my app.

@vickzeinkiv
Copy link

vickzeinkiv commented Feb 18, 2025

We faced the same problem on our project.

We updated from 0.41.0 to the latest 0.53.0 (which does not even have changelog).

We found out that everything works fine up to version 0.51.0.
But on 0.52.0+ the watcher sees only changes in config files, and there are no regular styles.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants