#How to stop vite HOT file from being generated automatically?

10 messages · Page 1 of 1 (latest)

young ivy
#

When I run npm run dev and then go to my site for the first request, a /public/hot file gets generated automatically. I can delete and it stays deleted for further requests. However it always makes the file again on docker rebuilds. Any idea how I can stop this?

zenith berry
#

That file is used by Laravel when you run the Vite dev server. It's required for that to work properly.
If you deploy your app you'd run a build, not use the dev command

young ivy
#

When I open the site I get a blank page unless I delete thar file. (I'm running SSR)

zenith berry
#

If you delete that file, npm run dev does nothing anymore, Laravel will then fallback to the assets that were built previously. So, open devtools in your browser and look for errors

young ivy
#

I seee, I get hit with a lot of cross origin site errors from vite and react:
The Same Origin Policy disallows reading the remote resource at http://[::1]:5173/@vite/client

zenith berry
#

What's your setup? How are you serving the app locally? Do you use https?

young ivy
#

Serving it through docker under the same container and via http

zenith berry
#

Then you'd also need to open that port

young ivy
#

I do as far as I am aware, I have it defined in my ports in the compose file:

    ports:
      - "8000:8000"
      - "5173:5173"
      - "3000:3000"
young ivy
#

Adding the --host flag to the end of the dev command fixed it 😄