Vite + Herd Share #211
-
Context: Laravel 9.52 If I fun local domain: This seems to be a CORS issue which makes sense, but how can I solve this? If I run How can I get herd share and vite to be on the same page? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
The reason it fails is because If you want to develop while testing with |
Beta Was this translation helpful? Give feedback.
-
Assuming I understood the problem correctly, I got it working by setting the server:hmr:host to the URL of my site in Herd. import { defineConfig } from 'vite'; export default defineConfig({ |
Beta Was this translation helpful? Give feedback.
-
Just found another solution. If you update your application's |
Beta Was this translation helpful? Give feedback.
The reason it fails is because
npm run dev
will spin a server to host your assets like css and js available through port5173
so that it can hot-reload them. When usingherd share
you only proxy port 80 or 443 depending on your configuration. So your styles and scripts won't be available.If you want to develop while testing with
herd share
I recommend to runvite build -w
instead which will build your assets constantly while making changes.