Button Edit Action disappear after first click
Button Edit from my ViewResource header always disapear after first click (see video attached). On the client side I have this error on the console from Morph.js . I can't figure out what's happened. It happens on other part of my UI. Also its only in production where I use FrankenPHP. The livewire/update request retuns a 200 with the button present in the Livewire response. Morph dom seem to fail to morph the dom accordingly ? Any ideas of this issue ?
20 Replies
After a few debuggin using debugger To is assigned to a Text Node in Morph.js so I cant call setAttribute on it ? But whi it is set to a Text Node ?
Please share the code for your action and your view resource?
"To" node in Morph dom is assigned to this text '\n\n' ? Is this an escaping issue ?
Hmm, that looks ok to me. What is in your edit form?
Do you have an EditChatter class or is it a simple resource?
It's a simple resource
I have also this error here on the frontend where a button click dont do nothing
On my phone so can’t see the video.
after first click and the error come from alpineJS
Uncaught TypeError: Cannot read properties of undefined (reading 'dispatchEvent')
Do you have a repo you can share?
These bug only appear in prod where I have two Laravel container for zero downtime updates. Livewiere is stateless right ?
The code you shared looks ok to me.
Also another hint when I restart the servers its fine for a few days, then the error appears
Sounds like a possible cache conflict.
Hard to say though.
If it’s only happening in prod then it’s something with the server.
OK I might investigate this. THanks you for your time. I just noticed right now that all my containers restarted in the same time a few hours ago and the bug happended right after. Same last time. Your guess seems right. On update containers starts one after each other (Docker Swarm rolling update). But on VPS reboot they all start together. This is my startup script
Are there potential issues if the two laravel app run this simultaneously ?
Sorry, I’ve never worked with octane so I wouldn’t be able to offer any real advice. But even in memory if its different servers I wouldn’t expect a collision.
Maybe something’s getting replicated before the initial stuff finishes.
Can you show me the browser console errors?
From Laravel doc :
When a command is marked as Isolatable, Laravel will automatically add an --isolated option to the command. When the command is invoked with that option, Laravel will ensure that no other instances of that command are already running. Laravel accomplishes this by attempting to acquire an atomic lock using your application's default cache driver. If other instances of the command are running, the command will not execute; however, the command will still exit with a successful exit status code:
i will try to add
--isolated
to some of the commands if they are isolatable
. I restarted the two laravel app (one by one) and not at same time and it works fine now. The issue araised when they are start at same time.
Thanks you for your time you pointed me toward the good direction !Odd, yea. Sorry, I just don’t have enough experience with octane. Please share the solution if you figure it out though.
I will try to investigate more to find the precise reason but yes it's very odd ! For the moment I will just try to never launch the two Laravel app at the same time as a workaround. (docker start order) .