Hi everyone,
I’ve been struggling for over two days trying to deploy a Laravel 11 project on a shared hosting environment (Hostinger), and I’m encountering a persistent issue with the Vite manifest file not being found.
Setup:
• Laravel version: 11
• Using: Vue3, Inertia, Vite, Tailwind, and PHP 8.2
• Server: Hostinger (Shared Hosting)
• No root access, limited to shared hosting features.
Problem:
I’ve set up my project according to the typical deployment steps, including moving the contents of the public folder to public_html, configuring the vite.config.js file, and binding the public path in the AppServiceProvider.php. Despite following the recommended practices for adjusting the public path and successfully running npm run build, Laravel still throws an error:
Vite manifest not found at: /home/u639623795/domains/mydomain.com/public_html/build/manifest.json
This is confusing because the manifest.json file does exist in the correct path (public_html/build). I’ve also tried clearing all caches (routes, views, config, etc.), running fresh builds, and adjusting file permissions.
What I’ve Tried:
1. AppServiceProvider.php: I’ve bound the public path like this:
$this->app->bind('path.public', function() {
return base_path('../public_html');
});
2. vite.config.js:
export default defineConfig({
plugins: [
svgLoader(),
laravel({
input: 'resources/js/app.js',
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
quasar({
sassVariables: 'src/quasar-variables.sass'
})
],
build: {
outDir: '../public_html/build',
emptyOutDir: true,
}
});
3. Correct folder structure:
• public_html/ contains the build files (assets, manifest.json, etc.)
• The main Laravel app files (routes, config, resources, etc.) are outside public_html.
The Issue:
Despite these efforts, Laravel keeps looking for the Vite manifest in the correct path but fails to find it. I’m stuck at this point and not sure what else to check or change. I’m wondering if there’s something specific to shared hosting or Laravel 11’s handling of Vite assets that I’m missing.
Has anyone else experienced this issue or have insights on what could be going wrong with deploying Laravel 11 on shared hosting?
Thanks in advance!