Alpine component ax-load-src doesnt fetch in v4

Hello, I've tried to update some package to use v4 and registering alpine component and usage, doesnt fetch the file even tho it exists and it is accessible.
AlpineComponent::make('package', __DIR__ . '/../resources/dist/package.js') // In service provider
AlpineComponent::make('package', __DIR__ . '/../resources/dist/package.js') // In service provider
<div
ax-load
ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('package', 'owner/package') }}"
x-data="doStuff({
state: $wire.entangle('{{ $getStatePath() }}'),
})"
>
<div
ax-load
ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('package', 'owner/package') }}"
x-data="doStuff({
state: $wire.entangle('{{ $getStatePath() }}'),
})"
>
Same thing works in v3
Solution:
The syntax of Async Alpine changed with v2: https://async-alpine.dev/docs/ I know Dan built a compatibility layer for v3. Not sure whether that also works in v4...
Async Alpine
Getting Started β€” Async Alpine Documentation
How to get started with Async Alpine to load Alpine.js components lazily, for a quick start using a CDN.
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Kochβ€’4mo ago
The syntax of Async Alpine changed with v2: https://async-alpine.dev/docs/ I know Dan built a compatibility layer for v3. Not sure whether that also works in v4
Async Alpine
Getting Started β€” Async Alpine Documentation
How to get started with Async Alpine to load Alpine.js components lazily, for a quick start using a CDN.
Sasa Orasanin
Sasa OrasaninOPβ€’4mo ago
Ah, thats it, changing from ax to x prefix πŸ˜„ Didnt even see it in docs how small diff it was, thanks πŸ˜„

Did you find this page helpful?