fuwari icon indicating copy to clipboard operation
fuwari copied to clipboard

Why does it not reload the site when changes are made in dev mode?

Open golam71 opened this issue 1 year ago • 7 comments

if i run the repo after doing pnpm install and pnpm ad sharp when i run pnpm run dev

it should hot reload like any other astro template so i can actually see the changes live how can i make it hot reload as in reload when i make changes to the code?

golam71 avatar Sep 25 '24 17:09 golam71

The astro dev command run by pnpm run dev supports hot reload and should be enabled by default. Or is it something like --watch?

L4Ph avatar Sep 26 '24 14:09 L4Ph

@L4Ph It still doesnt hot reload for me even if I use --watch can you confirm it works for you as in it hot reloads when you make changes with --watch?

golam71 avatar Sep 26 '24 14:09 golam71

@golam71 I have confirmed that HMR do not working. Currently, I'm in the middle of debugging, so I can't say for sure, but it appears that --watch is compiling a large amount of CSS from <style></style> tags written within .astro files.

I suspect this is the cause, but it may take some time to investigate.

L4Ph avatar Sep 26 '24 15:09 L4Ph

I succeeded in activating it.

L4Ph avatar Sep 26 '24 16:09 L4Ph

@golam71 It seems to be as expected. I think Tailwind CSS is basically written in base.css and compiled. I confirmed that HMR does not work when you write (such as @tailwind utilities) in <style lang="css"></style> .

I will issue a PR then.

L4Ph avatar Sep 26 '24 16:09 L4Ph

pls me assign @saicaca

L4Ph avatar Sep 26 '24 16:09 L4Ph

Incredible guys, i was struggling to find the cause and wow you already found it

meltingbots avatar Sep 26 '24 21:09 meltingbots

It has been merged into main. Is it okay to close this issue?

@saicaca @golam71

L4Ph avatar Oct 29 '24 02:10 L4Ph

It works thank you very much :)

golam71 avatar Nov 20 '24 13:11 golam71