v2.17.35 problem on windows
Hai, I just updated my projects to .35 but my admin panel is only show blank page,
however it happen to 2 of 3 of my projects that use filament
and this only happen at my env (windows, laragon), my friend that using mac os is not getting the problem.
tested to downgrade to .34 and it's working normally
64 Replies
hey
i know this is a problem
but i cant reproduce it
@andrewwallo please continue your debugging here
@stevee94 im gonna need you to dig into what exactly is different about these projects compared to your others
plugins, custom scripts, other customizations you may have made
Okay, yeah cause Iβm using Laragon on Windows as well
yeah but you tried it on a new project?
Yes new project it is fine
and also Steve said it worked for one of his projects too?
so maybe its not Laragon
there must be a common demoninator here
i just donβt understand what it is
things like this that break the entire admin dont happen often, they are usually reproducanle
Session database?
try clearing your session maybe
but i doubt it
idk why that would affect js
yap, and the all 3 projects use similar plugins, scripts, etc
can you share any of the apps that might be easy for me to set up locally
Branch 1.x of ERPSAAS
Let me get the link one sec
GitHub
GitHub - andrewdwallo/erpsaas at 1.x
Contribute to andrewdwallo/erpsaas development by creating an account on GitHub.
You don't need to, but just letting you know that I made a database seeder for it:
You just need to input your info here just for a quick setup, but not needed at all
But its 4:00AM where I live so I will be back here tomorrow to figure it out...
filament update 2.17.35 error
caught SyntaxError: Unexpected token '}' (
scroll up, i cant reproduce the problem
please help me.
How ?
create a reproduction repository
i have tried installing filament in a new project and it worked for me
@andrewwallo i just installed epssaas 1.x, updated Filament to .35, and it works
Very weird then
Cause itβs the exact same project I have
yeah
I guess windows then?
sure, but i dont understand why
Yeah me neither
i cant see anything that has changed π
has sortable.js been updated recently?
uh i dont know
@cerelli can you find the AssetController.php file in /vendor
you see the line that says
->send()
if you remove that, does it work?Yes
ok @danharrin my guess was right then
so this is the fix?
ok
thanks
let's revert that pr
GitHub
Do not send unnecessary headers when pretending to be a file by lin...
This PR enhances the handling of Set-Cookie headers, which Laravel typically includes in every request. By preventing these headers, files can more effectively simulate being the requested assets. ...
Thanks for the swift help everyone here!
Glad issue was found π
Thanks!
I've released a new version @andrewwallo @cerelli @stevee94
Sounds good
ehmm still not fix on my side
still blank page
please run
php artisan about
which filament version are you onv2.17.36
ohh looks its my cache, sorry
I upgraded to v2.17.36 and now everything works. Thanks.
okay, work now, thank u guys
thanks
awesome!
Weird mine doesnβt work after upgrading and everything, with still same error, but since it seems others are working maybe itβs browser cache idk
Could you try clearing your browser cache?
Yeah
Hmm, try different browser
This could be due some non-filament assets that got no version query string prefix on their css, js files and these got cached by CF causing some problems for some people. π
I had no problems in production but I am not using many of 3rd party plugins too. π
this isnt a CF issue
its a problem with Laragon on Windows
locally
I see. I have never used Laragon.
neither, so i had a hard time replicating this bug
I reset computer and everything, it works now!
I might check though. It would be nice to have CF caching enabled. I guess
ln
into filament dist might be a workaround to enable CF caching for now. πClassic fix! Haha, glad it works now
Probably something to do with either Apache or Nginx
Well, go to sleep now, Andrew π
Haha yeah sound good
Out of interest does anybody know why this happens? What does Laragon do differently?
Probably some windows wizardry. I will need to try and see though. The only difference was that files were not sending Set-Cookie headers anymore and acted more like real static files. :))
It should be something windows related but this works in Laragon when you terminate the response right after headers and content is sent. I will do some further testing and maybe we can retry this PR @danharrin ?
hmm right
its weird though isnt it
Indeed, but I think when it's not terminated on windows you get a malformed output for JS with error in a console that leads to what people here seen. π
but if I add Content-Length header this looks to work properly.
I will test on my other machines too and if it's good will resubmit PR. π
I do believe it's because Laragon works on HTTP 1.1 and you need to send Content-Length to clearly define when to end the receiving, otherwise Laravel probably adds some extra bits and makes the received file malformed. I guess HTTP 2 works differently, and that's why me and you have not seen this when testing on our machines.
So both ways work - terminating right after content and headers are sent or clearly defining content-length. Technically, we could just terminate, as there is no real reason for us to pass response through other middlewares for Laravel.
Sending the content-length header is optional in HTTP/2. See section 8.1.2.6 of RFC 7540:
"A request or response that includes a payload body can include a content-length header field."
The header is not required since HTTP/2 includes sufficient information in the frame headers for a user agent to determine when a resource has been sent in full.
Yeh so the cause is HTTP/1.1https://github.com/filamentphp/filament/pull/6426 for your judgement.
PR added Accepted-Ranges and Content-Length headers for HTTP/1.1 users but these will be auto-discarded by a server using HTTP/2. Right after we send headers and content the process is terminated as there is no need for any further processing by Laravel.
GitHub
Do not send unnecessary headers when pretending to be a file by lin...
PR #6407 improvement with fixes for HTTP/1.1 users.
I've had problems beforehand with Apache and Filament before the error occurred yesterday, but then I changed to Nginx a couple of weeks ago and it has been a much better experience than before. Just because I am curious, I wanted to ask, what is the purpose of the
AssetController.php
file? I am curious because I usually see things such as "Expires, Cache-Control, Content-Length, etc..." that would usually be configured not in the Laravel application itself, but in the local server's configuration files. Could this not possibly cause conflicts?in v2, you dont need to publish any css or js to your /public directory to be able to use Filament
this is because we instead use the AssetController to trick the browser into thinking that the files exist, when in reality they are just controller responses
Livewire does the same thing
in v3 weve gotten rid of the asset controller and you just have a command to publish assets instead.
Okay sounds good, was just wondering. Thanks!