F
Filament15mo ago
Mohmd

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
awcodes15mo ago
What is your production APP_URL set to in env? It’s either that or you nginx config is off.
Mohmd
Mohmd15mo ago
It’s APP_URL=https://yc.om
Dennis Koch
Dennis Koch15mo 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
Mohmd15mo ago
I did npm run build then I copied the files !
Dan Harrin
Dan Harrin15mo ago
cant you just build them on your server instead of copying
Mohmd
Mohmd15mo ago
how I can add public to the path ?
Dennis Koch
Dennis Koch15mo ago
You shouldn't. /public should be your root, otherwise your server is misconfigured
Mohmd
Mohmd15mo ago
how I can do it ?
Mohmd
Mohmd15mo ago
now live wire not loading !
Dennis Koch
Dennis Koch15mo ago
Do you have the vendor folder installed?
Mohmd
Mohmd15mo ago
yes
toeknee
toeknee15mo ago
Did you run npm install, npm build after deployment on the deployment server?
Mohmd
Mohmd15mo ago
yup
Dennis Koch
Dennis Koch15mo 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
Mohmd15mo ago
now it working i changed the asset path to public in livewire config
Dennis Koch
Dennis Koch15mo ago
Everything works now? Site is served from public/ and there is no public/ in URL anymore?
toeknee
toeknee15mo ago
Sounds like you have a poor hosting setup your domain should be routing to public
Mohmd
Mohmd15mo ago
now the public images not showing in filament do you have any idea !
Dennis Koch
Dennis Koch15mo ago
Please provide some information 🤷🏼‍♂️
Mohmd
Mohmd15mo ago
this what is showing
Mohmd
Mohmd15mo ago
Mohmd
Mohmd15mo ago
Mohmd
Mohmd15mo ago
but in front page is working fine, I added .htaccess to the public_html
Dennis Koch
Dennis Koch15mo 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
Mohmd15mo ago
how can I can make it pointing to public, throw .htaccess ?
Mohmd
Mohmd15mo ago
Dennis Koch
Dennis Koch15mo ago
Via DocumentRoot. Please search for a tutorial on how to setup Laravel on Apache.
Mohmd
Mohmd15mo ago
my file structure
Dennis Koch
Dennis Koch15mo 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
Mohmd15mo ago
okay make since
krekas
krekas15mo ago
and env variables should be set to production ones
Mohmd
Mohmd15mo 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 Koch15mo ago
That's also a solution if you can't set a DocumentRoot. Btw. you still have Debugbar active
toeknee
toeknee15mo 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
Mohmd15mo ago
yes I will disable it I wish to use Forge but the company the website owner did't accept
Dennis Koch
Dennis Koch15mo ago
It's always hard with limited hosting and always causes issues 🙈
Mohmd
Mohmd15mo ago
what we can do 🤣
toeknee
toeknee15mo 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
veldmuizie15mo ago
Atleast you still can use $GLOBALS 😂
Want results from more Discord servers?
Add your server
More Posts
Is it possible to change action on row click?I was wondering if it's possible to trigger another action when user clicks on a row? e.g. I would lSet table row limit in testsHeyo. Not sure if there are questions for this already, couldn't see any but my search terms might nIs it possible to enable particular component during view?I have tried to do ``disabled(false)`` but the component remains disabled. Is it possible to overridHow to customise title in SelectFilter loaded via relationship?I have the following filter and would love to concat ``title`` with ``prefix`` field. How it's possiIs it possible to hide some form elements when calling via view action?I would like to somehow detect that form was loaded by using view action and modity the form layout Key value column implementation for settings tableI have settings table with two columns `key and value` . I want a setting resource to set multipleWhat are my options to use repeater component as collapsible element inside table?I would like to have products listed inside collapsible panel on a table with some actions attached How can I update a form input on action?I have action button on edit page and would like to update a particular input on edit form. How can File Attachment Does Not Exist on Media Library Plugin/Form BuilderHi, I don't understand why I get "File Attachment Does Not Exist" . I am using Spatie Media LibraryImage ValidationHi, I'm using fileupload, and wanted to validate the image height and width(using max or min height