laravel-nova-csv-import icon indicating copy to clipboard operation
laravel-nova-csv-import copied to clipboard

Nova experienced an unrecoverable error.

Open khawala opened this issue 1 year ago • 5 comments

hello all i got this error when i try to upload the csv file i don't know why it was work before Nova experienced an unrecoverable error. local.ERROR: foreach() argument must be of type array|object, null given {"userId":1,"exception":"[object] (ErrorException(code: 0): foreach() argument must be of type array|object, null given at ...\vendor\laravel\framework\src\Illuminate\Http\Resources\ConditionallyLoadsAttributes.php:20)

khawala avatar Nov 05 '23 09:11 khawala

@khawala Please if you can share:

  • the relevant CSV import code (if you've customised the importer)
  • a sample of the CSV data you're trying to import (be sure to anonymise any personal data of you or your users etc)
  • any relevant DB migrations
  • the model and Nova resource classes that you're importing the data into

It's only possible to investigate these issues with all of this.

simonhamp avatar Nov 05 '23 13:11 simonhamp

@simonhamp hello sir this package was work with me before now whatever i choose as a csv file only after i click on upload and config image i got this error
image i don't have any customization in the import class and this is the csv file users.csv

khawala avatar Nov 06 '23 22:11 khawala

I'm also getting same issue and not able to find uploaded file in storage directory.

CleanShot 2023-11-07 at 06 52 17

prakhargvp avatar Nov 07 '23 01:11 prakhargvp

any update

khawala avatar Nov 12 '23 08:11 khawala

Because you have some error on one of the resources. Open the log file on the project and see what it is about, or add public static $canImportResource = false; foreach resource.

Bibesko avatar Dec 06 '23 11:12 Bibesko