Sage + Vite repo help

I was keen on trying vitejs and found this Sage + Vite repo which seems really good:
GitHub - ravorona/sage: Wordpress theme, based on Sage starter theme

I wondered if anyone here has tried this? I have the latest dev-devlop branch running on top of Bedrock (without using Trellis) and can compile with yarn build, but I’m having trouble getting HMR loading in my browser when running yarn dev. I keep hitting a page which just reads “Cannot GET /” when I try to access any of
http://example.local:3000,
localhost:3000,
127.0.0.1:3000.

My env reads:


HMR_HOST=localhost
HMR_PORT=3000
HMR_ENTRYPOINT=http://${HMR_HOST}:${HMR_PORT}

# Certificates
# HMR_HTTPS_CERT=path_to_cert
# HMR_HTTPS_KEY=path_to_key

# If true hot reload is active
# HMR_ENABLED=true
# HMR_ENTRYPOINT=http://example.local:3000

I have tried different versions of this, commented out HTTPS parts as I’m not using a certificate locally. The last two lines are taken from the repo but the first 3 lines are new on dev-develop, so Ive tried different combinations of using them or not.

Has anyone else got HMR working, and could you point me in the right direction? I suspect its something obvious that I’m overlooking!

Many thanks

1 Like

Hey @gareth do you had any update on this? Were you able to make it work or did you find any other option to use Sage with Vite?

I haven’t really looked at it since, I really should! I do remember, a few months after my post, seeing @nathobson raise an issue in the repo and said he’d got it working… here it is: Referencing assets (fonts, images) in SCSS/CSS files? · Issue #12 · ravorona/sage (github.com)