-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.x] Fix Invalid URL issue with Vite 6.0.9 #317
Conversation
This PR resolves the "Invalid URL" error that occurred due to the requirement that the server.origin value be a URL, introduced in the recently released Vite 6.0.9.
It's fixed in Vite 6.0.10. Backlinks: #316 and vitejs/vite#19241. |
While Vite 6.0.10 fixes this issue. I noticed I am getting a CORS issue in development mode.
Update: This error did not occur previously. |
Converting this to a draft while I investigate the issue further. |
I found that adding the following config to the server: {
cors: true,
}, |
@jayan-blutui, although that does get things back on track, you should keep in mind that it exposes you to the vulnerability that Vite patched: GHSA-vg6x-rcgg-rjx6 I'm working on a Laravel-flavoured CORS fix: #318 |
Mate, you're a legend! Totally overlooked that vulnerability. Really appreciate the work you do 💯 |
Thanks, @batinmustu. I've pushed a couple of commits to:
|
Hi, This is not working for me on localhost, there is another solution? thank you |
This PR resolves the “Invalid URL” error encountered when running npm run dev or npm run build. The issue arises from the requirement introduced in Vite 6.0.9 that server.origin must be a valid URL. The configuration has been updated to comply with this requirement.
This commit updates the default server.origin value in laravel-vite-plugin from
__laravel_vite_placeholder__
tohttp://laravel-vite-plugin.test
. This change resolves the “Invalid URL” error that occurred when attempting to create a URL with the server.origin value following the update to Vite 6.0.9, which enforces server.origin to be a valid URL.The updated value has been tested in Vite 6.0.8 and earlier versions, confirming compatibility and no issues when used as a valid link.
Vite 6.0.9 changes