Project is not auto-updating

Repro:

  1. Remix https://glitch.com/edit/#!/elite-violet
  2. Show the app.
  3. Change Test in src/app.jsx to something else.

Expected:

  1. App auto-updates when Test is changed to latest code.

Actual:

  1. The tab running the live app reloads.
  2. But it continues to show old code.

Comments:

  • Other projects auto-update just fine.
  • Am I doing something weird in React? I don’t see any errors in the Chrome DevTools Console.
  • I’m aware of the refresh command in the Glitch terminal, but auto-updating for this project seems consistently broken.
1 Like

The issue is likely due to .jsx files not triggering a restart. You should be fine once you add a watch.json file to the root of your project with the contents:

{
  "restart": {
    "include": [
      ".jsx$",
      ".js$"
    ]
  },
  "throttle": 100
}

This will trigger a restart on changes to .js or .jsx files add other extensions as needed.

2 Likes

That solved it, @shindakun. Thanks!

P.S. does that throttle property let me configure how many milliseconds elapse before Glitch triggers a re-deploy?

It’s the time from when you began to make a change to when it’s applied, see the readme in our example for more info: https://glitch.com/edit/#!/project/watch-json