#[Solved] Vite hot reload not working

1 messages · Page 1 of 1 (latest)

dull flower
#

Hey guys,

up until now vite pretty much worked perfectly for me, but I'm having trouble now for some reason. The hot update is not working anymore, even if I F5 / Ctrl F5 the page my changes are not reflected if I do not restart the vite server manually each time. I have no clue whats going an, the console shows the hmr update and no errors in browser console. Browser console also shows that vite is connected. Any advice? I'm using version 3.10 which worked perfectly fine on previous projects.

finite depot
#

Any more details on your project configuration? Do you see anything in the terminal output for the dev script?

dull flower
#

Nope I don't see anything at all. What exact details do you need? Here's my package

#
{
  "scripts": {
    "dev": "vite",
    "build": "vite build"
  },
  "devDependencies": {
    "@tailwindcss/forms": "^0.5.2",
    "alpinejs": "^3.4.2",
    "autoprefixer": "^10.4.2",
    "axios": "^0.27",
    "laravel-vite-plugin": "^0.6.1",
    "lodash": "^4.17.19",
    "postcss": "^8.4.6",
    "tailwindcss": "^3.1.0",
    "vite": "^3.1.8"
  },
  "dependencies": {
    "@headlessui/vue": "^1.7.2",
    "@heroicons/vue": "^1.0.6",
    "@inertiajs/inertia": "^0.11.0",
    "@inertiajs/inertia-vue3": "^0.6.0",
    "@vitejs/plugin-vue": "^3.1.0",
    "nprogress": "^0.2.0",
    "vue": "^3.2.36",
    "vue-cookies": "^1.8.1",
    "vue-loader": "^17.0.0",
    "vuedraggable": "^4.1.0"
  }
}
#

Funnily, when I save a component, the window scrolls back up again but no changes are reflected.

#

Console:

#
[vite] connecting... client.ts:19:8
[vite] connected. client.ts:134:14
#

vs code console:

VITE v3.1.8  ready in 365 ms

 ➜  Local:   http://localhost:5173/
 ➜  Network: use --host to expose

 LARAVEL v9.35.1  plugin v0.6.1

 ➜  APP_URL: http://localhost:8000
14:54:28 [vite] ✨ new dependencies optimized: @heroicons/vue/solid
14:54:38 [vite] page reload resources/js/pages/frontend/ProductList.vue
dull flower
finite depot
dull flower
#

Stupid me, I figured it out.

#

Mounting inertia like this

resolve: (name) => resolvePageComponent(`./pages/${name}.vue`, import.meta.glob('./pages/**/*.vue')),
#

And calling the pages folder Pages..

#

Well well. Only took me three hours to figure out lol

#

Thanks for your assistance tho @finite depot

finite depot
dull flower
#

Not sure what you're implying and of course its a stupid mistake but I think we've all been there.

finite depot
#

Sorry, I meant in the complementary sense in that these stupid things can hold you up for days sometimes, realise that might not have come across...

dull flower
#

All good 🙂 Thanks for taking the time