Error on Large Exports: Trying to access array offset on value of type null in FilesystemManager #4247
Unanswered
johnvitor0220
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm encountering an issue with Laravel Excel when exporting large datasets (e.g., 20,000 rows). The export works perfectly for smaller datasets (e.g., 2000 rows), but when the data size increases, I get the following error:
Trying to access array offset on value of type null {"url":"http://local.app.loc","exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type null at /var/www/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php:118)
My application uses a multi-tenant architecture where each tenant has its own dedicated filesystem folder. I have a middleware that dynamically sets the correct config('filesystems.disks.local.root') value based on the tenant. This ensures each request points to the proper folder in the filesystem.
When debugging the FilesystemManager.php file around line 118, it seems like the disk configuration (config('filesystems.disks')) becomes unavailable during large exports.
However, with a small export, the config is there:
I experimented sending the diskOptions like this:
But the problem persists.
Sorry I'm writing this in a hurry, so if more details are needed, I'm willing to explain better
Beta Was this translation helpful? Give feedback.
All reactions