© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
13 replies
hxnnxs

Black screen in production + canAccessPanel not working

Hello everyone! I encountered a very strange bug in production.
When trying to log in to the panel via an authorized email, I get a black screen and 2 errors in the console related to livewire:
1) The script from "https://example.com/livewire/livewire.min.js?id=38dc8241" was loaded, although its MIME type ("text/html") is not valid for JavaScript.
2) Uncaught SyntaxError: expected expression, got '<'
The strangest thing is that I received these errors when I had @livewireStyles and @livewireScripts in the head and body of the site.
(I have the 'inject_assets' => true option enabled in the config).

The problem is also that anyone can log in via example.com/admin, although User.php has a normally implemented canAccessPanel method.

Code:
User.php:

use Filament\Models\Contracts\FilamentUser;
use Filament\Models\Contracts\HasName;
use Filament\Panel;
...
class User extends Authenticatable implements FilamentUser, HasName
{
use HasFactory, Notifiable, SoftDeletes;
protected $fillable = [
'id',
'bio',
'nickname',
'avatar',
'email',
'password',
'provider',
...
];

/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'password',
];

public function getFilamentName(): string
{
return $this->nickname ?? 'admin';
}

public function canAccessPanel(Panel $panel): bool
{
return $this->email === 'crashermoney0@gmail.com';
}
...

AdminPanelProvider:
return $panel
->default()
->favicon(asset('images/logo/favicon.png'))
->id('admin')
->path('admin')
->brandLogo(asset('images/logo/favicon.png'))
->brandLogoHeight('3rem')
->login()
}
...

P.S. I can't insert the whole code because of the limitation, but I can show everything else that is needed without any problems❤️
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

ImportAction not working in production
FilamentFFilament / ❓┊help
3y ago
canAccessPanel() Not being called
FilamentFFilament / ❓┊help
12mo ago
Login not working (Production)
FilamentFFilament / ❓┊help
2y ago
Dafault Css/Tailwind Not working in production
FilamentFFilament / ❓┊help
2y ago