hhxsv5 / laravel-s

LaravelS is an out-of-the-box adapter between Laravel/Lumen and Swoole.
MIT License
3.83k stars 470 forks source link

Swoole server not load ziggy-js, Ziggy is not defined error appears. #362

Open medyun opened 3 years ago

medyun commented 3 years ago
  1. Your software version (Screenshot of your startup)

    Screen Shot 2021-07-13 at 10 00 17
  2. Detail description about this issue(error/log) I'm trying to run my project with swoole, but I'm getting an error in ziggy js. It works fine for the first couple of requests, but then it starts giving the following error.

Screen Shot 2021-07-13 at 10 02 01

I tried this solution but nothing changed.

Can you help me to solve this problem?

  1. Some reproducible code blocks and steps

hhxsv5 commented 3 years ago

Need to reset BladeRouteGenerator::$generated.

Try to add ZiggyCleaner.

<?php
namespace App\Cleaners;
use Hhxsv5\LaravelS\Illuminate\Cleaners\BaseCleaner;
use Tightenco\Ziggy\BladeRouteGenerator;
class ZiggyCleaner extends BaseCleaner
{
    public function clean()
    {
        BladeRouteGenerator::$generated = false;
    }
}
hhxsv5 commented 3 years ago

If the problem is solved, LaravelS v3.7.21 will be released, which will have built-in ZiggyCleaner