Laravel Vite does not work nicely with Warden #571
jkenneydaniel
started this conversation in
Ideas
Replies: 1 comment 8 replies
-
I've converted this into a discussion until we have actionable steps. Then we'll open an issue 🙂 I'm unfamiliar with Vote, but reading your post reminds me a lot of some similar stuff I've had to do with React and I find that to be the easiest approach. If Vite is compatible, it may be worthwhile to have something like js..test that points to a configured port on the php image |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Scenario:
Installing the latest version of Laravel (v9.44.0) with Vite (v4.0.1), Jetstream (v2.13.1) and Inertia.js (v0.6.4).
Expectation:
Running
npm run dev
would result in a similar experience to Webpack when usingnpm run watch
.Problem:
Because Vite uses a port similar to livereload, one must use
npm run dev -- --https --host
instead, which partially resolves the issue. However, because Warden uses a self-signed certificate with it's on CA cert, Vite cannot/does not leverage this and so you must visit the URL in your browser to accept the certificate before proceeding further.The
https
flag will configure Vite to load resources over HTTPS, but this tries to uselocalhost
or127.0.0.1
and unless the port used (default: 5174) is exposed, this does not work.The
host
flag will configure Vite to leverage the domain (ie.app.domain.test
) to load resources over so that there is no CORS concerns/issues, etc.I feel like this isn't necessarily a bug, but rather a feature request for Warden to support Vite by modifying the way it inserts the CA and SSL cert for the domain of the environment such that Vite can leverage them to prevent unnecessary steps on the part of the end-user.
I did modify my Warden config to push the SSL certs Warden is using for my domain to the environment (which appeared to work successfully) - however, it appears the format of these keys are not supported by Vite or something?
I'd like to hear some thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions