I get the following error when running queued exports (even if run synchronously) from Laravel Nova:
Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function forPage() on null in .../vendor/maatwebsite/excel/src/Jobs/AppendQueryToSheet.php:92
extends QueuedExport implements WithMapping, ShouldAutoSize, has a simple headings() and map() function which comply with the docs.Expected behavior:
No error & export should complete.
Actual behavior:
See above
Reverting to Laravel-Excel 3.1.17 fixes the error. I also debated whether to report this here or in the Nova-Excel repo, but issue definitely originates from this repo, not the other one.
Same problem here
I've locked Laravel Nova Excel to use 3.1.17 for now, until we find a fix for it.
@patrickbrouwers any updates?
any updates? with 3.1.17 not update Laravel 7
Same here, in our case it's caused by update of
The export action class looks as follows:
class Export extends QueuedExport
{
public function __construct($resource)
{
$filename = sprintf('%s-%s.csv', $resource->uriKey(), time());
$fields = collect($resource->fields(request()));
$return = $this
->askForWriterType()
->withHeadings($fields->pluck('name')->toArray())
->withFilename($filename)
->only($fields->pluck('attribute')->toArray())
->onSuccess(function (ActionRequest $request, PendingDispatch $queue) use ($filename) {
$queue
->chain([
new NotifyUserOfCompletedExport($request->user(), storage_path("app/{$filename}")),
]);
return Action::message('Your export is queued!');
});
return $return;
}
public function name()
{
return __('Export');
}
}
Affects all the lenses, irregardless of complexity.
Queued exports are deprecated in 1.2.x, there's currently no way of supporting them anymore unfortunately. See release notes https://github.com/Maatwebsite/Laravel-Nova-Excel/releases/tag/1.2.0 If you really need queued exports, you should create a custom action and queue a Excel::store yourself. If anybody finds a way of serializing the Nova query so we can access it from the queue, feel free to PR it.