Closed toxifiedmatrix closed 3 years ago
Hello,
I have same error.
No problem with the main component all working
Livewire v2.3.2
I'm having this problem only after I use alpine, for the smooth modal based transitions along with the livewire create.blade.php
component. I have no idea if there is something wrong on my part, or a bug in livewire.
Same when I use AlpineJS (Interface with Tabs)
There are bugs or some sort of compatibility issues along with alpine.js when combined with livewire.
Could you provide your Livewire and Alpine versions?
There are bugs or some sort of compatibility issues along with alpine.js when combined with livewire.
In the contrary, Alpine and Livewire are made to help one another, so, unless you're using incompatible versions of both of them, there shouldn't be any "lone" issues.
Livewire 2.3.2 AlpineJS 2.7.3
Could you try removing the parenthesis when calling your create action?
-<button wire:click.prevent="create()">
+<button wire:click.prevent="create">
Create
</button>
It's happened when livewire try to change the DOM. And with a sub component
Hmm, this smells like another pesky morphDOM issue. @toxifiedmatrix do you think you could provide a github repo we could clone to reproduce this?
I'm currently having the same javascript exception, and it seems like something when you use both blade conditional display and alpine x-show together. If I understood correctly, alpine searches for the to-be-hidden element via x-show, and since it became hidden (removed from DOM) by blade already, it can't find it and throws that exception. And I'm not sure how I may fix this. Maybe something like re-initializing alpine when the DOM changes may work. But I'm not sure it'll be the best solution.
It's already there refreshAlpineAfterEveryLivewireRequest()
on SupportAlpine.js:15
, so I don't have anything to add :)
Hello, people,
I have been facing similar issues.
Basically, the problem is that Livewire (through Alpine.js), is trying to remove a style attribute from the element, but the element does not have any style attribute originally.
Now, you can manually just add a style attribute to your component and avoid the error, appearing. BUT this would not probably resolve your issues in general.
Based on my recent experience, it is not a good idea to create a Livewire component for only a modal (or anything with a dynamic display property). Instead, try to "attach" the component to a more generic element that does not apply the x-show directive on it directly.
I hope it makes sense to some of you.
PS: Alternatively, you can try to use the @entangle directive of alpine, to synchronize the visualization or a component across Livewire and Alpine.js.
Hello,
In my issue, I don't have modal or something else.
it worked in alpinejs v2.7.0 but the same error on the updated version of alpinejs
Same issue with alpinejs v2.8.0
If someone can provide a sample repo that demonstrates the issue, I'd be happy to have a look at it, to work out what the bug is and see if we can get it resolved. π
Hello @joshhanley,
I just created a branch in my repo.
Please, let me know if something else is needed.
Thanks and best wishes.
@JuanDMeGon thanks! I'll check it out π
I have PR'd a fix for this #2268.
Thanks @JuanDMeGon for the repo! It was very helpful!
Way to go! Thanks for that.
π Oh Hi! I'm Squishy, the friendly jellyfish that manages Livewire issues.
I see this issue has been closed.
Here in the Livewire repo, we have an "issues can be closed guilt-free and without explanation" policy.
If for ANY reason you think this issue hasn't been resolved, PLEASE feel empowered to re-open it.
Re-opening actually helps us track which issues are a priority.
Reply "REOPEN" to this comment and we'll happily re-open it for you!
(More info on this philosophy here: https://twitter.com/calebporzio/status/1321864801295978497)
Introduction
I'm creating a crud functionality within the livewire stack. I'm getting the following error when I am trying to load the
create.blade.php
component as modal using alpine.js. Its working perfectly when I use@include('livewire.user-base.user.create')
but it ain't working and throwing a set of error when trying to load the same thing as a livewire component using<livewire:user-base.user.create />
.Error Which I'm Getting In The Console
Source Code
namespace App\Http\Livewire\UserBase\User;
use Livewire\Component; use Livewire\WithPagination; use App\Models\User; use App\Models\Role;
class Index extends Component { use WithPagination;
}
<?php
namespace App\Http\Livewire\UserBase\User;
use Livewire\Component; use App\Models\User; use App\Models\Role; use Illuminate\Support\Facades\Hash;
class Create extends Component { public $name; public $email; public $password; public $role;
}
Manage User
{{ session('success') }}
{{ session('delete') }}
{{$message}}
@enderror{{$message}}
@enderror{{$message}}
@enderror{{$message}}
@enderror