0

Working with laravel 9 / filament": "^2.17.17 app I use npm run dev command in root project, so all my changes I made in PhpStorm are applied in my browser (Chrome Version 110 under kubuntu 20.04 ) without browser page reloading.

But this mode does not work always and I have to press in my browser F5(or CTRL+R) to see my new changes are applied. As I see autoupdate does not work in some cases:

a) I have PHP run time error, like $var not found and I have laravel error screen,

b) In console of my browser I see some error, like : Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

Also that could be some other JS error in console, in cases when I misuse some library component.

c) Seems it does not work in dialog, when RelationManager is used.

Are there some ways to check/fix that autoupdate works ok now at the moment? Also if there is way to show current status of autoupdate somewhere in the app toolbar ? Like “autoupdate currently updating / autoupdate updated 30 seconds ago etc...” to help with at dev mode?

ADDITIVE INFO:

After some works it looks like that I even do not need to run command :

npm run dev 

to force my app to make autoupdate automatically.

But in some cases automatical autoupdate does not work and I do not know why. Some details about my app and OS : package.json :

{
    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "@alpinejs/focus": "^3.10.3",
        "@tailwindcss/forms": "^0.5.2",
        "@tailwindcss/typography": "^0.5.4",
        "alpinejs": "^3.10.3",
        "autoprefixer": "^10.4.7",
        "laravel-echo": "^1.15.0",
        "laravel-vite-plugin": "^0.7.2",
        "postcss": "^8.1.14",
        "pusher-js": "^8.0.2",
        "tailwindcss": "^3.1",
        "vite": "^4.0.0"
    }
}

composer.json :

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^8.0.2",
        "bensampo/laravel-enum": "^6.3.1",
        "cviebrock/eloquent-sluggable": "9",
        "filament/filament": "^2.17.21",
        "filament/forms": "^2.17.21",
        "filament/spatie-laravel-media-library-plugin": "^2.17.21",
        "filament/spatie-laravel-settings-plugin": "^2.17.21",
        "filament/spatie-laravel-translatable-plugin": "^2.17.21",
        "filament/tables": "^2.17.21",
        "filipfonal/filament-log-manager": "^1.2",
        "guzzlehttp/guzzle": "^7.5",
        "hisorange/browser-detect": "^4.5.4",
        "jeffgreco13/filament-breezy": "^1.5.3",
        "kenepa/resource-lock": "^1.1",
        "lara-zeus/sky": "^2.3.7",
        "laravel/framework": "^9.52.5",
        "laravel/sanctum": "^3.2.1",
        "laravel/telescope": "^4.14.1",
        "laravel/tinker": "^2.8.1",
        "leandrocfe/filament-apex-charts": "^1.0.2",
        "livewire/livewire": "^2.12.3",
        "orangehill/iseed": "^3.0.3",
        "phpsa/filament-authentication": "^2.4",
        "pusher/pusher-php-server": "^7.2.2",
        "pxlrbt/filament-environment-indicator": "^1.0",
        "ralphjsmit/laravel-filament-components": "^1.2",
        "ryangjchandler/filament-profile": "^0.3.0",
        "saade/filament-fullcalendar": "^1.7",
        "spatie/laravel-health": "^1.22.5",
        "spatie/laravel-medialibrary": "^10.7.16",
        "spatie/laravel-permission": "^5.10.0",
        "spatie/laravel-settings": "^2.8.3",
        "spatie/laravel-tags": "^4.3.7",
        "stephenjude/filament-debugger": "^1.2",
        "wiebenieuwenhuis/filament-char-counter": "^1.1",
        "z3d0x/filament-fabricator": "^1.1.4"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.8.1",
        "barryvdh/laravel-ide-helper": "^2.13",
        "fakerphp/faker": "^1.21",
        "laravel/pint": "^1.8",
        "laravel/sail": "^1.21.4",
        "mockery/mockery": "^1.5.1",
        "nunomaduro/collision": "^6.4",
        "phpunit/phpunit": "^9.6.6",
        "spatie/laravel-ignition": "^1.6.4"
    },
    "autoload": {
        "files": [
            "app/Library/helper.php"
        ],
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force",
            "@php artisan filament:upgrade"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true
        }
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}


uname -a
Linux master-at-home 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

 free
              total        used        free      shared  buff/cache   available
Mem:        8057500     6742712      137432      193100     1177356      824920
Swap:       2104476     2102280        2196

What can it depend on ? Is it isseu of livewire, filamentphp, npm ? Who also suffer this issue ?

Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91

0 Answers0