Dfx makes vite live reload banana

I’ve been experiencing this issue for quite some time, and it has become more predominant. About once a week, I find myself having to clean the dfx temporary folder (rm -r .dfx or dfx start --clean). Otherwise, Vite’s live reload goes bananas - it starts acting strangely and triggers unexpected live reloads of the local server. This not only affects the development experience but also becomes really annoying as it often prevents my global CSS from properly reloading. Consequently, I’m forced to manually restart my development server each time this happens.

I’m using a Mac M2, and I’ve attempted to exclude .dfx from Vite’s watch list, but it didn’t help.

Is anyone else facing this issue? Have you found a solution?

What’s your folder setup like? I’ve been working on the vetKeys bounty the last few weeks with vite and vue, and haven’t come across this issue. But could be because of the structure I’ve used. It’s not perfect, but didn’t have any issues like what you’re describing :sweat_smile:

That’s my project and structure :point_right: https://github.com/buildwithjuno/juno.

I tried adding .dfx to server.watch.ignored but, it had no effect.

Ummm this annoying issue is probably related to the issue I had in the past (link below). I did not clean my state today as I got other shit to do like focusing on develoment and ultimately landed on the exact same issue.

Dashboard: http://localhost:53452/_/dashboard
Sep 03 12:36:12.975 CRIT s:5cqln-fyjg5-daroa-qrliu-sje6t-dojp4-vufr3-kriuk-nri7t-bf2ri-4ae/n:y6yri-zvzgy-zww6q-hsolr-4265y-nfcm2-fgo2x-awstv-udcsm-yni5c-nae/ic_state_manager/tip Failed to serialize to tip @138800: /Users/daviddalbusco/projects/juno/juno/.dfx/network/local/state/replicated_state/node-100/state/tip/canister_states/00000000000000040101/canister.pbuf: Failed to open file for write: Too many open files (os error 24)
thread ‘TipThread’ panicked at ‘Failed to serialize to tip @138800: /Users/daviddalbusco/projects/juno/juno/.dfx/network/local/state/replicated_state/node-100/state/tip/canister_states/00000000000000040101/canister.pbuf: Failed to open file for write: Too many open files (os error 24)’, rs/state_manager/src/tip.rs:280:33
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace