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
awcodes
awcodes2y ago
What is your production APP_URL set to in env? It’s either that or you nginx config is off.
Mohmd
MohmdOP2y ago
It’s APP_URL=https://yc.om
Dennis Koch
Dennis Koch2y ago
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
Mohmd
MohmdOP2y ago
I did npm run build then I copied the files !
Dan Harrin
Dan Harrin2y ago
cant you just build them on your server instead of copying
Mohmd
MohmdOP2y ago
how I can add public to the path ?
Dennis Koch
Dennis Koch2y ago
You shouldn't. /public should be your root, otherwise your server is misconfigured
Mohmd
MohmdOP2y ago
how I can do it ?
Mohmd
MohmdOP2y ago
now live wire not loading !
Dennis Koch
Dennis Koch2y ago
Do you have the vendor folder installed?
Mohmd
MohmdOP2y ago
yes
toeknee
toeknee2y ago
Did you run npm install, npm build after deployment on the deployment server?
Mohmd
MohmdOP2y ago
yup
Dennis Koch
Dennis Koch2y ago
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?
Mohmd
MohmdOP2y ago
now it working i changed the asset path to public in livewire config
Dennis Koch
Dennis Koch2y ago
Everything works now? Site is served from public/ and there is no public/ in URL anymore?
toeknee
toeknee2y ago
Sounds like you have a poor hosting setup your domain should be routing to public
Mohmd
MohmdOP2y ago
now the public images not showing in filament do you have any idea !
Dennis Koch
Dennis Koch2y ago
Please provide some information 🤷🏼‍♂️
Mohmd
MohmdOP2y ago
this what is showing
Mohmd
MohmdOP2y ago
Mohmd
MohmdOP2y ago
Mohmd
MohmdOP2y ago
but in front page is working fine, I added .htaccess to the public_html
Dennis Koch
Dennis Koch2y ago
And the image in public/images/YC-logo.svg exists? Sorry, but your server is still misconfigured. Domain root must be pointed to public/
Mohmd
MohmdOP2y ago
how can I can make it pointing to public, throw .htaccess ?
Mohmd
MohmdOP2y ago
Dennis Koch
Dennis Koch2y ago
Via DocumentRoot. Please search for a tutorial on how to setup Laravel on Apache.
Mohmd
MohmdOP2y ago
my file structure
Dennis Koch
Dennis Koch2y ago
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
Mohmd
MohmdOP2y ago
okay make since
krekas
krekas2y ago
and env variables should be set to production ones
Mohmd
MohmdOP2y ago
what I did to fix all props I moved all file to ycback in root directory and but all public file in pubic_html
Dennis Koch
Dennis Koch2y ago
That's also a solution if you can't set a DocumentRoot. Btw. you still have Debugbar active
toeknee
toeknee2y ago
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.
Mohmd
MohmdOP2y ago
yes I will disable it I wish to use Forge but the company the website owner did't accept
Dennis Koch
Dennis Koch2y ago
It's always hard with limited hosting and always causes issues 🙈
Mohmd
MohmdOP2y ago
what we can do 🤣
toeknee
toeknee2y ago
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?!?!'
veldmuizie
veldmuizie2y ago
Atleast you still can use $GLOBALS 😂
Want results from more Discord servers?
Add your server