F
Filament2mo ago
Nadee

How to Fix "Uncaught ReferenceError: richEditorFormComponent is not defined" After Hosting?

Hi, does anyone know about this? Everything works fine on localhost, but when I deployed it, I got the error : "Uncaught ReferenceError: richEditorFormComponent is not defined at [Alpine] richEditorFormComponent({ state: $wire.$entangle('data.body', false), }) (eval at safeAsyncFunction...." I've tried upgrading Filament, running composer update, and other steps, but the RichEditor still doesn't work after deployment. Other components are working fine. Thanks
pict after deploy
Solution:
wow, anyway, i've successfully solved the issue. Thank you for responding to me before🙏. I tried deleting the assets directly from the server and then ran php artisan filament:install --forms and php artisan livewire:publish --assets😁
Jump to solution
24 Replies
Dennis Koch
Dennis Koch2mo ago
Check your DevTools console. Sounds like some of your JS files are missing or have bad content Or try running php artisan filament:assets
Nadee
NadeeOP2mo ago
I've also tried it, but it still doesn't work😞. It might be because alpine.js is not loaded properly
No description
LeandroFerreira
LeandroFerreira2mo ago
you could try php artisan vendor:publish --force --tag=livewire:assets this publishes livewire assets
toeknee
toeknee2mo ago
Yeah I would check your resources folder for overrides
Nadee
NadeeOP2mo ago
okaa I've already tried that, but the error is still the same🙏
toeknee
toeknee2mo ago
php artisan storage:link?
Nadee
NadeeOP2mo ago
yes ,i've tried running that 😞
toeknee
toeknee2mo ago
have you checked your network logs for the .js and compared the two?
LeandroFerreira
LeandroFerreira2mo ago
Any JS customization? Custom theme, app.js, .. ?
Nadee
NadeeOP2mo ago
it looks good all the .js files are returning status 200 no i haven't made any customizations to the JS files or theme. Everything is still using the default setup oh, but I did make styling customizations using extraAttributes() in the RichEditor component to set a minimum height
LeandroFerreira
LeandroFerreira2mo ago
Is it a Filament resource or custom page?
Nadee
NadeeOP2mo ago
it's a filament resource and here is the code
No description
Dennis Koch
Dennis Koch2mo ago
Did you check the actual result? Is it Javascript? Servers can return 200 but still deliver different content
Nadee
NadeeOP2mo ago
yes ive checked, the response shows that the content returned is js. here, I added a screenshot or did i miss something?
No description
toeknee
toeknee2mo ago
Have you compared it to the local version?
Nadee
NadeeOP2mo ago
ohh wait lemme check again
Nadee
NadeeOP2mo ago
in my local version, the rich-editor file is there, but on the hosting, it's missing😔. Looks like the file isn't there, as you can see above
No description
toeknee
toeknee2mo ago
Exactly... There is your issue So Run php artisan filament:assets Also ensure to run npm run build
Nadee
NadeeOP2mo ago
oh, okaa the only thing i haven't tried is npm run build before, but after did it i got an error saying that "EMFILE : too many files open". Does this mean i need to increase the number of file descriptors?
No description
Nadee
NadeeOP2mo ago
Hi, anyway, I've finished running npm run build, but the same issue still persists. Any advice? I also tried redeploying, but it's still not working. When I try to access it manually, like at https:/**/js/filament/forms/components/rich-editor.js, the rich-editor file exists (it's uploaded to the folder where I'm hosting it). However, I don't know why it's not loading properly on the web
toeknee
toeknee2mo ago
That's very strange
Dennis Koch
Dennis Koch2mo ago
Can you check the files in the public/js/filament/forms/components folder?
Nadee
NadeeOP2mo ago
yess on my local and hosting server
No description
No description
Solution
Nadee
Nadee2mo ago
wow, anyway, i've successfully solved the issue. Thank you for responding to me before🙏. I tried deleting the assets directly from the server and then ran php artisan filament:install --forms and php artisan livewire:publish --assets😁

Did you find this page helpful?