Following the instructions on the docs
npm create svelte@latest my-app
cd my-app
npm install
npm run dev
I created and ran a svelte project on wsl2. The project was created and the server ran properly but, HMR was not working.
After a long time spent bashing my head on the keyboard I found out that vite is unable to detect file changes in wsl2
So I just installed node on windows and created then ran the project through cmd and every thing was fine