© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3mo ago•
2 replies
sparclex

Custom async alpine component field with vite and without panel

I have an existing laravel installation with filament components (without the panel builder). Now I want to add a custom field with an async alpine component and do not want to install esbuild since I already have vite. In my
app.js
app.js
file i register the component.
import {Livewire, Alpine} from '../../vendor/livewire/livewire/dist/livewire.esm';
import AsyncAlpine from 'async-alpine';
import './bootstrap'

Alpine.plugin(AsyncAlpine);
Alpine.asyncData('tselect', () => {
    console.log('loading typesense select')
    return import("./filament/typesense-select.js");
});
Livewire.start()
import {Livewire, Alpine} from '../../vendor/livewire/livewire/dist/livewire.esm';
import AsyncAlpine from 'async-alpine';
import './bootstrap'

Alpine.plugin(AsyncAlpine);
Alpine.asyncData('tselect', () => {
    console.log('loading typesense select')
    return import("./filament/typesense-select.js");
});
Livewire.start()

My base layout file ends with
@livewireScriptConfig
@filamentScripts
@vite([
'resources/js/app.js',
])
</body>
@livewireScriptConfig
@filamentScripts
@vite([
'resources/js/app.js',
])
</body>

But when initializing the component with the following code
    <div
        x-load
        x-data="tselect"></div>
    <div
        x-load
        x-data="tselect"></div>

I get the error that
tselect
tselect
is not defined. When I remove the
@filamentScripts
@filamentScripts
the async component loads. Does anyone has an Idea how to get this working?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Custom field Alpine question
FilamentFFilament / ❓┊help
3y ago
Custom form field and Custom Livewire component
FilamentFFilament / ❓┊help
2y ago
Alpine Async import module
FilamentFFilament / ❓┊help
13mo ago
panel Appears Unstyled After Adding Custom Theme with Vite
FilamentFFilament / ❓┊help
6mo ago