Closed zdarin closed 2 years ago
You should not use Vite's publicDir config, as that has a different purpose. Instead you may set the publicDirectory
for the Laravel Plugin.
// ...
laravel({
input: "resources/js/app.js",
publicDirectory: "public_html",
}),
// ...
Thx its fixed this with public error but in browser i have error
Failed to load resource: the server responded with a status of 500 ()
I think somthing with manifest / assests it should be ??
With that information I'm not sure what the issue is or if it is related to the vite plugin or not.
guys i have an issue when deploying a Inertia Laravel app, the issue is that i move the public folder's files from the larvel project to the public_html folder of the hosting, but this error occurs, is there a way to tell vite to look for the build folder in the public_html folder outside of laravel's directory?
delete config file on Hosting server from
bootstrap\cache\config.php
delete config file on Hosting server from
bootstrap\cache\config.php
yes i did that
idk why mine doesn't work, The Vite.php file is looking in the public folder of the laravel(folder structure that is in development)
@Rage-coder69, you need to tell Laravel where your new public directory is. You can do this in the register
method of a service provider:
$this->app->bind('path.public', function () {
return base_path('public_html');
});
@Rage-coder69, you need to tell Laravel where your new public directory is. You can do this in the
register
method of a service provider:$this->app->bind('path.public', function () { return base_path('public_html'); });
yes thank you for your reply, i had to tell laravel my new public directory and had to update the code in the core files, and after that tweaking, the website starting working.
Hey folks, I just removed some comments here as they were exposing your servers file structure and it could be a potential security risk.
Just better to be safe than sorry 🔐
Hello,
Can some one explain what im doing wrong Im working with shared hosting and when public folder renamed for public_html writes error can someone explain how correctly change without errors? Or its seems to be fixed ??
By npm run dev throws errors but seems working Or i need public folder exist too for laravel vite to work and public_html for host ?