Skip to content
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

[bug] bud-react not triggering react-refresh #2573

Open
3 tasks done
joshuafredrickson opened this issue Apr 11, 2024 · 0 comments
Open
3 tasks done

[bug] bud-react not triggering react-refresh #2573

joshuafredrickson opened this issue Apr 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@joshuafredrickson
Copy link
Sponsor Contributor

joshuafredrickson commented Apr 11, 2024

Agreement

Describe the issue

React doesn't refresh upon saving React components. However, it does work if you explicitly add the folder path of your React components to Bud's watch list.

For example:

bud.watch([
      'resources/views', 
      'app', 
      'resources/scripts/react-components'
]);

Basically the exact post here: https://discourse.roots.io/t/roots-bud-react-or-roots-bud-swc-v6-20-0-does-not-trigger-react-refresh-or-hot-reloading/26827/3

Expected Behavior

Hot reloading should work. 😄

Actual Behavior

Nothing.

Steps To Reproduce

  1. Add @roots/bud-react and @roots/bud-swc to a project. (Note: I've only tested this in a Sage theme.)
  2. Saving React components does not trigger refresh.

version

6.20.0

Logs

No response

Configuration

export default async (app) => {
  app
    .entry({
      app: ['@scripts/app', '@styles/app'],
    })
    .assets(['images']);

  app.setPublicPath('/wp-content/themes/whatever/public');

  app
    .proxy('https://site.test')
    .watch([
      'resources/views',
      'app',
      'resources/scripts/react-components/', // <-- Refresh works when this is added
    ]);
};

Relevant .budfiles

No response

@joshuafredrickson joshuafredrickson added the bug Something isn't working label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant