Skip to content

Bug: File update consistently triggers 2 update events on WindowsΒ #193

@ghiscoding

Description

@ghiscoding

On Windows (the only environment I can test with), watching files will consistently trigger 2 update events whenever any files are updated. The issue is very consistent and will always trigger 2 update events whenever a file (or multiple files) is updated, for every file 2 events will be sent

Repro

I created a small GitHub project as a full repro, you can follow the steps shown on the small project readme
https://github.com/ghiscoding/parcel-watcher-issue

Demo

Below is a demo of the issue, doing a file save triggers 2 update events consistently on Windows platform (I'm not sure if this happens on other platforms, possibly not)

Code_fOglgxJAgr

Alternative

For now the only way that I found to avoid rebuilding the same file(s) multiple times is to use a Set and add a delay of 150ms before calling the callback handler. It's a bit annoying to have to wait 150ms before calling the handler when I barely had to wait when I had the same code using Chokidar v3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions