A Call for help! launching Monday! Importing issue with livewire error

I know this is bit of a repost but we have urgent issue When importing participants to our relation manager we are getting Uncaught TypeError: Cannot read properties of null (reading 'first') at utils.js:75:16 at Array.reduce (<anonymous>) at W (utils.js:72:27) at Object.get (wire-model.js:49:28) at l (module.esm.js:2773:44) at module.esm.js:2796:46 at o (module.esm.js:2604:25) at module.esm.js:2669:5 at HTMLSelectElement.<anonymous> (module.esm.js:2606:52) (anonymous) @ utils.js:75 W @ utils.js:72 get @ wire-model.js:49 l @ module.esm.js:2773 (anonymous) @ module.esm.js:2796 o @ module.esm.js:2604 (anonymous) @ module.esm.js:2669 (anonymous) @ module.esm.js:2606 this is our relation manager https://gist.github.com/craigvc/979aaeaeba952ba6b44b8ecfc0a05c32 This is a test importer we tried https://gist.github.com/craigvc/cf9d645a4dc23d738badac8964db5e50 I have tried composer requiring livewire, adding livewire config, npm run build, npm run dev, clearing cache, removing all plugins from panel, and removing any extra js! Any help in debugging this would be GREATLY appreciated.
Gist
ParticipantsRelationManager.php
GitHub Gist: instantly share code, notes, and snippets.
Gist
Participant2Importer.php
GitHub Gist: instantly share code, notes, and snippets.
No description
28 Replies
mvenghaus
mvenghaus4mo ago
tested your code .. working for me maybe the csv file corrupt ? you're on the latest versions of filament and livewire?
nostrodamned
nostrodamned4mo ago
@mvenghaus hi yes just upgraded it all - tried a few csv files too I have it on a relation manager if that makes any difference
mvenghaus
mvenghaus4mo ago
still no problem did you test it on a more simple resource maybe conflicted with other stuff
mvenghaus
mvenghaus4mo ago
No description
nostrodamned
nostrodamned4mo ago
yes i have tried a couple of resources and same thing
mvenghaus
mvenghaus4mo ago
can you provide your sample csv ?
nostrodamned
nostrodamned4mo ago
it not even getting to that Its like the livewire goes weird
nostrodamned
nostrodamned4mo ago
its happening the minute the form opens - before i hit submit etc
mvenghaus
mvenghaus4mo ago
you don't click on import?
nostrodamned
nostrodamned4mo ago
no the error shows up minute it opens. If i do click on import it just jumps me to the validation error
mvenghaus
mvenghaus4mo ago
still no problem with the import .. it has to with something else tehre i would try removing everything except the import
nostrodamned
nostrodamned4mo ago
I have stripped everything from the relation manager and the resource that i can and nope! Its nuts this is the error in livewire.js function dataGet(object, key) { if (key === "") return object; return key.split(".").reduce((carry, i) => { if (carry === void 0) return void 0; return carry[i]; }, object); } dying on return carry[i];
mvenghaus
mvenghaus4mo ago
set a breakpoint in browser and look at the state maybe and just to make sure .. did you try restaring your server .. i know it's like restart your router when internet is not working .. but in the last days i had a problem and i was desperate .. and the problem was an old opcache 🙂
nostrodamned
nostrodamned4mo ago
ok sort of getting something. I used livewire debug and went back in time and got this Cannot access offset of type array on array
mvenghaus
mvenghaus4mo ago
you're getting clsoer
nostrodamned
nostrodamned4mo ago
ok i "think" it may be due to this
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class OrganizationsPermission
{
/**
* Handle an incoming request.
*
* @param Closure(Request): (Response) $next
*/
public function handle($request, Closure $next)
{

if (!empty(auth()->user()) && session('organization_id')) {
// session value set on login
setPermissionsTeamId(session('organization_id'));
}
// other custom ways to get team_id
/*if(!empty(auth('api')->user())){
// `getTeamIdFromToken()` example of custom method for getting the set team_id
setPermissionsTeamId(auth('api')->user()->getTeamIdFromToken());
}*/
return $next($request);
}
}
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class OrganizationsPermission
{
/**
* Handle an incoming request.
*
* @param Closure(Request): (Response) $next
*/
public function handle($request, Closure $next)
{

if (!empty(auth()->user()) && session('organization_id')) {
// session value set on login
setPermissionsTeamId(session('organization_id'));
}
// other custom ways to get team_id
/*if(!empty(auth('api')->user())){
// `getTeamIdFromToken()` example of custom method for getting the set team_id
setPermissionsTeamId(auth('api')->user()->getTeamIdFromToken());
}*/
return $next($request);
}
}
messing with the session?
mvenghaus
mvenghaus4mo ago
does it work when you remove the middleware ?
nostrodamned
nostrodamned4mo ago
no as that sets the permissions
mvenghaus
mvenghaus4mo ago
not completlty remove .. just for testing
nostrodamned
nostrodamned4mo ago
ok did that it wasnt that
mvenghaus
mvenghaus4mo ago
but if it's array on array .. there has to be something wrong with the state you try you import in a base form .. no relation ?
nostrodamned
nostrodamned4mo ago
no i dont think that error was right, i tried basic resource too
mvenghaus
mvenghaus4mo ago
it's hard to help without the whole picture
nostrodamned
nostrodamned4mo ago
happy to share the repo?/
mvenghaus
mvenghaus4mo ago
okay
mvenghaus
mvenghaus4mo ago
GitHub
mvenghaus - Overview
mvenghaus has 37 repositories available. Follow their code on GitHub.
nostrodamned
nostrodamned4mo ago
added branch is importchaos @mvenghaus Thank you SOOOO much for your help - our issue was joshembling/image-optimizer causing the issue! for all who may come across it.