Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When stopping the watcher each time an exception is thrown. #35

Open
gldrenthe89 opened this issue Oct 16, 2024 · 3 comments
Open

When stopping the watcher each time an exception is thrown. #35

gldrenthe89 opened this issue Oct 16, 2024 · 3 comments

Comments

@gldrenthe89
Copy link

Hi there,

I just started using this package. Before i was using nodemon npm package. The package is working fine but when stopping the process an exception is thrown: Spatie\Watcher\Exceptions\CouldNotStartWatcher

I am using Laravel Herd Pro for local development. Using Node 22.29.0, PHP 8.3.12, Redis 7.0.0 and Mysql 8.0.36 with latest updates installed from within Herd Pro

I have correctly installed the npm package 'chokidar' per documentation. It is on v4.0.1

Image

@jackwh
Copy link

jackwh commented Oct 16, 2024

I've had this problem occurring randomly for over a year, I'm not sure what the root cause is but it's definitely annoying!

As a workaround you can suppress this exception in bootstrap/app.php:

    ->withExceptions(function(Exceptions $exceptions) {
        $exceptions
            ->dontReportDuplicates()
            ->dontReport(\Spatie\Watcher\Exceptions\CouldNotStartWatcher::class);
    })

@gldrenthe89
Copy link
Author

Sometimes different Node versions will affect the behavior of some packages. You can try to use the LTS version of Node (such as 18.x) for testing. You can choose Servbay to switch the environment. Servbay supports one-click switching of Nodejs versions.

Hi thanks for the comment. I am actually using Laravel Herd Pro. I can switch Node very easely but this project needs Node 22. So unfortunatily i cant switch every time is start using this package. The package works fine, it is just this annoying little exception when stopping the watcher.

When i find the time i can try debug it myself. I whas just wondering if this something everybody has?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@jackwh @gldrenthe89 and others