deployment vite not working
I deployed my app to server but Vite css files not working waht I can do ?
Vite File
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
export default defineConfig({
plugins: [
laravel({
input: [
"resources/css/app.css",
"resources/js/app.js",
"resources/css/filament.css",
"resources/js/cdn.min.js",
"resources/js/alp.min.js",
],
refresh: true,
}),
],
});
39 Replies
What is your production APP_URL set to in env? It’s either that or you nginx config is off.
It’s APP_URL=https://yc.om
How did you deploy them? Seems like you didn’t build your assets but just copied the files with the link to the local vite dev server
I did npm run build then I copied the files !
cant you just build them on your server instead of copying
how I can add public to the path ?
You shouldn't.
/public
should be your root, otherwise your server is misconfiguredhow I can do it ?
now live wire not loading !
Do you have the vendor folder installed?
yes
Did you run npm install, npm build after deployment on the deployment server?
yup
Wait a minute.
vendor/
should not be accessible on a proper configure server, so that's fine. And this is also not the default Livewire.js path. Did you overwrite something?now it working i changed the asset path to public
in livewire config
Everything works now? Site is served from
public/
and there is no public/
in URL anymore?Sounds like you have a poor hosting setup
your domain should be routing to public
now the public images not showing in filament
do you have any idea !
Please provide some information 🤷🏼♂️
this what is showing
but in front page is working fine, I added .htaccess to the public_html
And the image in
public/images/YC-logo.svg
exists?
Sorry, but your server is still misconfigured. Domain root must be pointed to public/
how can I can make it pointing to public, throw .htaccess ?
Via DocumentRoot. Please search for a tutorial on how to setup Laravel on Apache.
my file structure
Your file structure is fine. Your server config is not.
That means that all your app configuration is accessible via browser: http://yc.om/.env
okay make since
and env variables should be set to production ones
what I did to fix all props I moved all file to ycback in root directory and but all public file in pubic_html
That's also a solution if you can't set a DocumentRoot.
Btw. you still have Debugbar active
You can use document root, in htaccess but this should be done on the server level with the document root to the domain, not within the .htaccess. That's a poormans and problematic approach.
Look into basic deployment practices for Laravel, Forge is a good starting point.
yes I will disable it
I wish to use Forge but the company the website owner did't accept
It's always hard with limited hosting and always causes issues 🙈
what we can do 🤣
Tell me about it... I currently have to VPN to one clients server running php5.6, asked for them to implement FPM solution form multi php versions, they just replied 'What?!?!'
Atleast you still can use $GLOBALS 😂