HMR in Lando

How is HMR suppose to work in a Lando env with Radicle?

Requests to /bud/hot 404 and I can’t figure out how to route this request to build container where bud is running.

My setup:

  1. Follow documentation for Radicle Lando setup
  2. lando start
  3. lando yarn dev to start bud
  4. My site is accessible and working, but 404s on /bud/hot

In Lando, requests traverse the Lando Proxy (traefik) which routes to the appserver. It seems like there should be a way to tell Lando to route /bud/hot requests to build container, where bud is running?

I’ve tried a few different bud.config.js and .lando.yml options, but no dice.

The documentation is unclear in this regard, yet advertises out-of-the-box HMR support. :expressionless: Shouldn’t this be added to the boilerplate .lando.yml (however you do it)?

Im following this - i’ve gotten it working intermittantly -
its more reliable for tailwindcss than javascript and better with frontend than backend … anecdotal

usually by some combination of flushing the cache at various levels normally focusing on lando for hmr although sometimes its bud related

To clear Lando’s internal cache, you can use a few different approaches, depending on what you want to achieve. Lando manages Docker containers and services to create your local development environment, and sometimes these can hold onto cached data that you want to reset.

I usually start with stop/start or rebuild

1. Rebuild Your Lando App

The lando rebuild command is often the first step when you’re trying to clear out any issues with your Lando setup. This command will rebuild your app’s containers from scratch, which can clear out many types of cached data.

lando rebuild

2. Restart Lando

Restarting Lando can sometimes help, especially if there are issues with the services.

lando restart

this one is more extreme but I found it cleaned up some weird stuff I was experiencing It took me so many tries to get something working I ended up with a stupid amount of containers and this purges the unused ones - be careful with this one - but if you have one you want and its active - you can quickly clear out the rest

3. Clearing Docker’s Cache

Since Lando is built on Docker, clearing Docker’s cache can sometimes help. Be careful with this as it can affect all Docker containers, not just those managed by Lando.

docker system prune

This command will remove all stopped containers, unused networks, dangling images, and build cache.

Ive also had a couple times where Ive cleared the vendor
and all the storage framework cache and re downloaded /rebuilt
delete the yarn lock and composer lock , the cache files in the storage folder etc

and move to bud nightly until you find a working setup and then maybe lock it in if you haven’t done that yet

im on the bud nightly
@roots/bud”: “2023.11.7-8”,
@roots/bud-eslint”: “2023.10.30-8”,
@roots/bud-imagemin”: “2023.10.30-8”,
@roots/bud-preset-wordpress”: “2023.10.30-8”,
@roots/bud-prettier”: “2023.10.30-8”,
@roots/bud-stylelint”: “2023.10.30-8”,
@roots/bud-swc”: “2023.10.30-8”,
@roots/bud-tailwindcss”: “2023.10.30-8”,
@roots/eslint-config”: “2023.10.30-8”,

10.30-8

basically try stuff until you find the magic combo - and make sure you are staying on top of clearing cache so you don’t miss a setup that will work

for context it took me a month 2-3 weeks of zero success with trellis - and lando another week to smooth everything out - happy on lando although there are quirks - but im windows wsl2 and Ill take anything that works at this point

let me know what else you find out good luck

thanks, but I’ve tried all those and none of that worked.

Looking at the code and configs, I don’t think there is anything built into Radicle that instructs traefik to route /bud/hot to the bud server.

I’m disappointed, as part of the marketing of Radicle is to eliminate this exact kind of troubleshooting work.

and you upgraded bud config to the nightly ?

radicle package json is locked back in august you need to move to nightly for bud