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.
28 Replies
tested your code .. working for me
maybe the csv file corrupt ?
you're on the latest versions of filament and livewire?
@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
still no problem
did you test it on a more simple resource
maybe conflicted with other stuff
yes i have tried a couple of resources and same thing
can you provide your sample csv ?
it not even getting to that Its like the livewire goes weird
its happening the minute the form opens - before i hit submit etc
you don't click on import?
no the error shows up minute it opens. If i do click on import it just jumps me to the validation error
still no problem with the import .. it has to with something else tehre
i would try removing everything except the import
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];
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 🙂
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
you're getting clsoer
ok i "think" it may be due to this
messing with the session?
does it work when you remove the middleware ?
no as that sets the permissions
not completlty remove .. just for testing
ok did that it wasnt that
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 ?
no i dont think that error was right, i tried basic resource too
it's hard to help without the whole picture
happy to share the repo?/
okay
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.