Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading 'get') #176

@oliverbj

Description

@oliverbj

Hi there.

I have a Laravel application, where I am trying to install Alpine.js (Using NPM) together with wire-elements/modal. In my app.js file I have this:

require("./bootstrap");
require("alpinejs");

window.Alpine = Alpine;

Alpine.start();

I am loading the app.js file in my app.blade.php view file:

    <!-- Scripts -->
    <script src="{{ mix('js/app.js') }}" defer></script>
    <script src="{{ mix('js/modal.js') }}" ></script>

This gives me an error like the below though:

Uncaught TypeError: Cannot read properties of undefined (reading 'get')

If I remove Alpine.start(); from my app.js file, the error goes away (but Alpine is not working then).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions