I change the nginx config web root to just /web because I don’t install it under /bedrock root /www/kinsta/public/sage-latest/web;
Install Sage theme: Navigate into the themes dir cd /web/app/themes/ and install dev-main: composer create-project roots/sage sage-dev-main dev-main
cd sage-dev-main && npm install && npm run build and enable new theme.
My Issue
Run npm run dev and in the output I see APP_URL: undefined but it is running correctly at http://sage-latest.local/. What port is hot reloading on?
> dev
> vite
VITE v6.0.11 ready in 249 ms
➜ Local: http://localhost:5173/app/themes/sage/public/build/
➜ Network: use --host to expose
➜ press h + enter to show help
LARAVEL plugin v1.2.0
➜ APP_URL: undefined
When I add this change to the app.css file if I manually reload, the site it does reflect the css change, but hot reloading does not work.
There may be a better way to handle this for bedrock setups, but this vite config seems to work if you want to define your APP_URL in your bedrock .env:
I didn’t notice APP_URL was undefined but I get that too. In my case, it doesn’t seem to matter though. If I go to my test site at http://sage.test hot reloading works as expected without any extra configuration.
There’s no docs just yet, but a proper Sage 11 pre-release is high on our list of priorities right now.
Thank you for such a detailed topic. Using the dev version and reporting issues/providing feedback like this is very helpful for everyone.
Like @Log1x, I don’t need to define APP_URL for HMR to work, but both you and @csorrentino at a minimum are needing it for whatever reason. I’ve made a note to mention it in the docs, but maybe we can figure out a better solution.
Apologies for adding to the confusion. It looks like I also don’t need to have it defined for hot reloading to work with my dev setup (Valet). I guess I immediately tried to resolve the console message without realizing it’s a non-issue for me.