Lifetime access is $100 off. Ends this week.Join here →

Livewire/Alpine conflicts

Hey all,

I've no doubt there is an obvious conflict that I am missing here but I've been googling and researching for a couple of days now and cannot seem to resolve this issue.

I've created a search functionality on my app (following the course) and have found that to get my search feature functioning as expected, it seems to break my livewire functionality (mainly that modals won't load anymore but the console shows innumerable uncaught errors stating:

Uncaught TypeError: wireEl.__livewire is undefined

If I "defer" my app.js script tag containing the code for the meilisearch/alpine feature, that fixes the livewire issue but breaks the search functionality and creates a [object HTMLInputElement] permanantly in my html input and the consoles shows innumerable errors again stating:

Uncaught TypeError: window.components is undefined

or that all my search functions/variables are undefined.

This is the ordering of script tags:

        <meta charset="utf-8">
        <meta name="application-name" content="{{ config('') }}">
        <meta name="csrf-token" content="{{ csrf_token() }}">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>{{ config('', 'VTRAC') }}</title>
        <link rel="shortcut icon" href="{{ asset('img/logos/favicon.ico') }}"  type='image/x-icon'>

        <!-- Styles -->
        <style>[x-cloak] { display: none !important; }</style>
        <link rel="stylesheet" href="{{ mix('css/app.css') }}">

        <script defer src="{{ mix('js/app.js')}}"></script>**



I've tried re-ordering and/or moving the app.js mixer to just before the /body close out etc... but just get the same issues.

Where am I going wrong? What have I missed?

Thanks in advance




Could you show your components and views so I can take a look further? Your app layout seems fine.