Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CLab's avatar
Level 3

Weird JS not loading if page doesn't contain livewire component (Livewire 3.x)

I recently upgraded my application to Livewire 3.x and all pages with a livewire component load fine. However, pages without a livewire component seem to not load the javascript and give errors in the console such as:

https://imgur.com/a/8tXP95J

My dependencies:

    "require": {
        "php": "^8.1.0",
        "doctrine/dbal": "^3.0",
        "enlightn/enlightn": "^2.1.0",
        "google/cloud-error-reporting": "^0.17.0",
        "google/cloud-logging": "^1.25",
        "guzzlehttp/guzzle": "^7.5.0",
        "laravel/framework": "^10.0",
        "laravel/tinker": "^2.8",
        "laravel/ui": "^4.2",
        "livewire/livewire": "^3.0",
        "nunomaduro/collision": "^7.0",
        "openspout/openspout": "^4",
        "power-components/livewire-powergrid": "^5.0",
        "spatie/invade": "^2.0",
        "spatie/laravel-google-cloud-storage": "^2.1.0"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.8",
        "beyondcode/laravel-er-diagram-generator": "^2.0",
        "brianium/paratest": "^7.3",
        "fakerphp/faker": "^1.9.2",
        "laravel/pint": "^1.13",
        "mockery/mockery": "^1.6.7",
        "larastan/larastan": "^2.7.0",
        "phpunit/phpunit": "^10.0"
    },

My vite config:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel(
            {
                input: [
                    'resources/sass/app.scss',
                    'node_modules/@popperjs/core/lib/popper.js',
                    // 'node_modules/popper.js/dist/popper.js',
                    'resources/js/app.js',
                    // 'resources/js/show-hide-password.js',
                ],
                refresh: true,
            }
            )
    ],
});

Any help is appreciated and I am willing to provide more information as needed (but don't know what could help in troubleshooting this issue)

0 likes
3 replies
CLab's avatar
Level 3

@colbyalbo Thanks I will try this. Is there any negative effects of just having an empty Livewire component on all pages?

colbyalbo's avatar

@CLab not that i can think of , other than having dead code in your app (which would drive me crazy)

Please or to participate in this conversation.