In my project I have two types of import, in the first type, I don't need more than one excel sheet, in the second type WithMultipleSheets implement with some sheets. When using WithProgressBar for the first case, I can see the progress bar perfectly through the laravel console. In the second case I can't. To catch the flaws of the second case I have to use try catch. My file with sheets is too big, when I generate an import I can't see what's going on.

first case (ok)
.. Realize that I implement several concerns (WithHeadingRow, WithProgressBar, ToModel, WithValidation, SkipsOnFailure)

Console:
I imported 197 vendors, no errors returned. With the console, I can see exactly what's going on.

second case

When trying to import an item file with 47736 records, remembering that it has excel sheets, the file returns this error:

follows my first sheets, the others are very similar to her.

I don't know if I have to pass the progress bar to too many sheets, or if some concerns are not being called. I've even tried to call the WithProgressBar concern on my sheets, but it also generates the same error. What do you suggest me ?
@felipemub I had the same issue when using multiple sheets. The trick is that your imports for each sheet doesn't know who's $this->output from ->withOutput. In order to solve it, add the ->withOutput($this->output) to your sheets or conditional sheets function.
A small example
class YtdImport implements ToModel, WithBatchInserts, WithChunkReading, WithMultipleSheets, WithHeadingRow, WithProgressBar, SkipsUnknownSheets
{
use WithConditionalSheets, Importable;
public function conditionalSheets(): array
{
return [
'Details' => (new YtdImport())->withOutput($this->output)
];
}
Hope it works in your case.
Best
Most helpful comment
@felipemub I had the same issue when using multiple sheets. The trick is that your imports for each sheet doesn't know who's
$this->outputfrom->withOutput. In order to solve it, add the->withOutput($this->output)to your sheets or conditional sheets function.A small example
Hope it works in your case.
Best