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
Uncaught SyntaxError: Invalid or unexpected token (at livewire.js?id=8a199ab2:9407:1Sounds
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 changedI followed the filament upgrade documentation
https://filamentphp.com/docs/3.x/panels/upgrade-guide this link and done the exact same
It's not really a Filament issue if
livewire.js
isn't loadingThis is what I get
Yes I know.
https://gist.github.com/ajithMagic/42f3886f02b43914fd5634692496e15c here is the output of the livewire.js file.
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.
Which LW version are you using?
The end of the comment is missing (last lines)
As per the
about
command the livewire version is 3.3.0That file is an automatically generated one and I have no clue why the last lines are missing?
Me neither. Compare it against
vendor/livewire/livewire/dist/livewire.js
and see whether they are missing there, tooIts 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)