Livewire error after upgrading filament from 2.x to 3.x

I have recently upgraded one of my project from Laravel 9.x to 10.x along with filament. I used the filament upgrade package from the filament website to do that. Once the upgrade is done Iḿ receiving an error Uncaught SyntaxError: Invalid or unexpected token (at livewire.js?id=8a199ab2:9407:1) . I did some research and I found some fixes telling that it is occurring because of the empty line on the project. So I have scanned my entire project and made sure there are no whitespace or blank line at the first line of php files. Thanks in advance.
12 Replies
Dennis Koch
Dennis Koch12mo ago
Uncaught SyntaxError: Invalid or unexpected token (at livewire.js?id=8a199ab2:9407:1
Sounds livewire.js didn't return Javascript. Check the response in the network tab and see what it returns. Sounds like a misconfiguration of your server. But weird that it worked with Livewire v2. I don't think that part changed
Ajith Lal
Ajith LalOP12mo ago
I followed the filament upgrade documentation
Dennis Koch
Dennis Koch12mo ago
It's not really a Filament issue if livewire.js isn't loading
Ajith Lal
Ajith LalOP12mo ago
This is what I get
No description
Dennis Koch
Dennis Koch12mo ago
Yes I know.
Ajith Lal
Ajith LalOP12mo ago
Gist
Livewire.js file after upgrading to filament v3
Livewire.js file after upgrading to filament v3. GitHub Gist: instantly share code, notes, and snippets.
Dennis Koch
Dennis Koch12mo ago
Which LW version are you using? The end of the comment is missing (last lines)
Ajith Lal
Ajith LalOP12mo ago
As per the about command the livewire version is 3.3.0
No description
Ajith Lal
Ajith LalOP12mo ago
That file is an automatically generated one and I have no clue why the last lines are missing?
Dennis Koch
Dennis Koch12mo ago
Me neither. Compare it against vendor/livewire/livewire/dist/livewire.js and see whether they are missing there, too
Ajith Lal
Ajith LalOP12mo ago
Its loading the same file. Once I removed the last lines on the JS files, the error is gone, but the page is not showing up (getting blank page)
Want results from more Discord servers?
Add your server