-
I am getting error in production. |
Beta Was this translation helpful? Give feedback.
Replies: 59 comments 5 replies
-
Where are you seeing this error? Have you made any amendments to the views? Are you trying to access the "$component" from your DataTable Component? |
Beta Was this translation helpful? Give feedback.
-
@bymaster - If this is still on-going, please post the content of your component, and let me know the parameters for when this occurs and I'll try to help. |
Beta Was this translation helpful? Give feedback.
-
lrljoe thank you for your interest. production.ERROR: Undefined variable $component (View: /home//public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home//public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home//public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home//public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) {"userId":1,"exception":"[object] (Illuminate\View\ViewException(code: 0): Undefined variable $component (View: /home//public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home//public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home//public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home//public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) at /home/**/public_html/storage/framework/views/a44ecec3de85ddb164272c81bd668beb42bbaaee.php:4) [2023-03-06 14:36:23] production.ERROR: Call to a member function getFrameFilters() on null |
Beta Was this translation helpful? Give feedback.
-
`?php namespace App\Http\Livewire; use Rappasoft\LaravelLivewireTables\DataTableComponent; class BankListTable extends DataTableComponent
}` |
Beta Was this translation helpful? Give feedback.
-
Are you dispatching a browser event on-click (for example), catching it in a parent component, doing something with the data, and then re-rendering the parent component? <div>
Your Parent Component Here - perhaps displaying some data etc.
<livewire table component here>
</div> Then you're emitting "multideleted", which causes that parent component to refresh? If so, that will cause the Table Component to become stale/out-of-sync, which will result in the $component no longer being valid, $component is passed to the filter-pills.blade.php via the rendering process for the Data Table. If you're passing something to another Livewire component, use the following to keep it all livewirey: $this->emitTo('YourComponentName', 'TheAction', ['TheData']); If you're reacting to actions within your |
Beta Was this translation helpful? Give feedback.
-
I have not made any changes to the views |
Beta Was this translation helpful? Give feedback.
-
Just to be on the safe side, have you issued a "php artisan view:clear" to clear down any cached views that may be causing an issue? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Also, you should chain your events in configure, as it makes it a little cleaner $this->setPrimaryKey('id')
->setSearchEnabled()
->setHideReorderColumnUnlessReorderingEnabled()
->setSearchStatus(true)
->setSingleSortingEnabled()
->setPaginationStatus(true)
->setHideBulkActionsWhenEmptyStatus(true)
->setReorderStatus(true)
->setDefaultReorderSort('sort', 'asc')
->setDefaultSort('id', 'desc')
->setBulkActions([
'multideleteBulkAction' => 'Sil',
]); |
Beta Was this translation helpful? Give feedback.
-
yes i posted |
Beta Was this translation helpful? Give feedback.
-
php artisan clear-compiled && |
Beta Was this translation helpful? Give feedback.
-
Does it happen on loading the table, or after interacting with your buttons, or after using a filter? |
Beta Was this translation helpful? Give feedback.
-
i saw this problem when i push updates to production |
Beta Was this translation helpful? Give feedback.
-
https://phplaravel-686214-3100644.cloudwaysapps.com/admin/payments/banks |
Beta Was this translation helpful? Give feedback.
-
That's behind a login, so I can't see it I'm afraid. I'm suspecting the issue is with another component causing the data table to become out-of-sync. If it happens after clicking on a button on the page, then that'd confirm my suspicions. You could try wrapping your table component with the following to get other components to ignore it when re-rendering. <div wire:key wire:ignore>
<livewire:your-table-component />
</div> |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I think you may be missing one or more PHP modules. I'd recommend that you do a phpinfo() on your production and development environments and compare the two. Are you seeing anything additional in your error log from your webserver, or your laravel log file? Or is it the same error as before? |
Beta Was this translation helpful? Give feedback.
-
Production: Local: |
Beta Was this translation helpful? Give feedback.
-
Which version of Laravel are you using? There are some substantial differences between PHP 8.0 and PHP 8.1 |
Beta Was this translation helpful? Give feedback.
-
[2023-03-06 16:17:48] production.ERROR: Undefined variable $component (View: /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) {"userId":1,"exception":"[object] (Illuminate\View\ViewException(code: 0): Undefined variable $component (View: /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) (View: /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/rappasoft/laravel-livewire-tables/resources/views/components/tools/filter-pills.blade.php) at /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/storage/framework/views/a44ecec3de85ddb164272c81bd668beb42bbaaee.php:4) [2023-03-06 16:17:48] production.ERROR: Call to a member function getFrameFilters() on null {"userId":1,"exception":"[object] (Error(code: 0): Call to a member function getFrameFilters() on null at /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php:285) |
Beta Was this translation helpful? Give feedback.
-
When you run php artisan view:clear Which version of Laravel are you using? |
Beta Was this translation helpful? Give feedback.
-
[2023-03-06 16:17:48] production.ERROR: Call to a member function getFrameFilters() on null {"userId":1,"exception":"[object] (Error(code: 0): Call to a member function getFrameFilters() on null at /home/686214.cloudwaysapps.com/sxfrgyqqhs/public_html/vendor/filp/whoops/src/Whoops/Handler/PlainTextHandler.php:285) Looks like there's a different issue with your Whoops setup as well, might be worth disabling Whoops for testing. |
Beta Was this translation helpful? Give feedback.
-
yes it is deleting |
Beta Was this translation helpful? Give feedback.
-
Production: Local: |
Beta Was this translation helpful? Give feedback.
-
There's a few bug fixes between 8.42 and 8.83 which may resolve this issue, also worth updating your production to PHP 8.1 as there are are substantial differences in how PHP operates between 8 and 8.1 Also in your production, you've got Bootstrap loading after Livewire scripts, you should be loading Bootstrap first, and then your livewire scripts, which may also be contributing to the issue. e.g.
It may also help you out to bundle bootstrap into your app.js instead. |
Beta Was this translation helpful? Give feedback.
-
#lrljoe i see this error in error logs on server [Mon Mar 06 09:17:56.741586 2023] [proxy_fcgi:error] [pid 28524:tid 140202051675904] [client 88.246.192.148:0] AH01071: Got error 'PHP message: PHP Fatal error: Cannot use int as default value for property Rappasoft\LaravelLivewireTables\Views\Co............ic = [...]; public $this = class Illuminate\Auth\AuthServiceProvider { ... }; public $parameter = [...] }; protected $routeResolver = class Closure { virtual $closure = "$this->Illuminate\Routing\{closure}", public $static = [...]; public $this = |
Beta Was this translation helpful? Give feedback.
-
That error is likely to relate to public function reorder($items): void
{
foreach ($items as $item) {
Banks::find((int)$item['value'])->update(['sort' => (int)$item['order']]);
}
} PHP 8.0 I'm not convinced supports that approach, fairly certain that came with 8.1, which would explain why it works in your dev environment. |
Beta Was this translation helpful? Give feedback.
-
I solved the problem by upgrading the php version to 8.1 on the server. |
Beta Was this translation helpful? Give feedback.
-
Great news!!! |
Beta Was this translation helpful? Give feedback.
I solved the problem by upgrading the php version to 8.1 on the server.
Thank you very much for your attention my friend.