Uncaught (in promise) TypeError: expression.trim is not a function

produkt

Feb 26th, 2025 10:07 AM

Uncaught (in promise) TypeError: expression.trim is not a function

I recently updated npm and composer and now when I try to login, I get the error above. Anyone else experiencing this? How do I fix this? The file generating the error is /vendor/livewire/livewire.js

bobbyiliev

Feb 26th, 2025 10:10 AM

Hey!

I'm not 100% sure, but this looks like it might be related to cached files after your recent updates. Try clearing everything and rebuilding your assets with these commands:

php artisan optimize:clear
npm cache clean --force
rm -rf node_modules package-lock.json
npm install
npm run dev
produkt

Feb 26th, 2025 10:29 AM

It didn't work :(

produkt

Feb 26th, 2025 11:24 AM

I had to do this (https://livewire.laravel.com/docs/installation#publishing-livewires-frontend-assets)

php artisan livewire:publish --assets

Report
1
bobbyiliev

Feb 26th, 2025 11:17 PM

Nice! Happy to hear that you got it working!