devedmonton / DES-Website

The Dev Edmonton Society website! We empower Edmonton Developers!
https://devedmonton.com
MIT License
22 stars 52 forks source link

bug: Project takes awhile to load on Windows, possibly breaking hot reload #358

Open ajyong opened 1 week ago

ajyong commented 1 week ago

tldr: I'm looking for Windows developers to chime in (possibly fix?) this problem. Both when running in WSL2 or bare metal, starting up this project takes a long time (1+ minute) with lots of hanging in between. Hot reload suffers due to latency.

Collecting these as I find them. Note: I don't use Windows as my daily dev machine, these issues were encountered by other folks while I was pair programming with them.

General Windows slowness

These are the speeds on my Mac M1 Max:

aaron@SAIKYO-Aaron-MBP:~/code/DES-Website [main ≡]$ npm run dev

> dev
> nuxt dev

Nuxt 3.11.1 with Nitro 2.9.4                                                                             2:48:39 p.m.
                                                                                                         2:48:39 p.m.
  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

ℹ Using default Tailwind CSS file                                                      nuxt:tailwindcss 2:48:41 p.m.
  ➜ DevTools: press Shift + Option + D in the browser (v1.1.3)                                           2:48:41 p.m.

ℹ Tailwind Viewer: http://localhost:3000/_tailwind/                                    nuxt:tailwindcss 2:48:42 p.m.
ℹ Vite client warmed up in 2803ms                                                                       2:48:45 p.m.
✔ Nuxt Nitro server built in 1955 ms                                                              nitro 2:48:46 p.m.
ℹ Vite server warmed up in 3187ms                                                                       2:48:46 p.m.

On Windows, every single timestamp takes 5-10x to happen, if not longer. To get to the point where localhost:3000 shows a website, it can take 2 minutes or even restarting the npm run dev command. Doesn't seem to matter if it's under WSL2 or bare metal.

WSL no hot reload

In WSL2, hot reload doesn't pick up file changes, although that's probably something we can fix with adding polling: true to the config file.

Related Issues

Seems like Windows dev experience can be flaky, and interactions between Nuxt and other packages seems to be the culprit.

arashsheyda commented 1 week ago

I don't use windows either, but maybe disabling devtools would help to speed up

https://github.com/devedmonton/DES-Website/blob/871362088046137bc2f97b31a5ddfae0d512e9e1/nuxt.config.ts#L4-L6