Skip to content

[Bug]: Watch runs once on save on Linux #6846

@ntwigs

Description

@ntwigs

Reproduction link or steps

import { watch } from "rolldown";

const watcher = watch({
  input: "src/main.js",
});

watcher.on("event", console.log);

await watcher.close();

What is expected?

A new log / build should start after each save.

  • Run node watcher.js
  • Save your src/main.js
  • You should see a new log appear in stdout
  • Save again n times
  • You should see n new logs appear in stdout

What is actually happening?

There's only a new log / build after the first save - then nothing happens.

  • Run node watcher.js
  • Save your src/main.js
  • You should see a new log appear in stdout
  • Save again
  • Nothing happens
  • Save another file
  • Another log appears in stdout
  • Save again
  • Nothing happens

System Info

System:
    OS: Linux 6.17 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
    Memory: 12.84 GB / 15.20 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.9.0
    npm: 10.9.2
    pnpm: 10.20.0
  Browsers:
    Brave Browser: 134.1.76.73
  Editor:
    NVIM v0.11.2
    Build type: RelWithDebInfo
    LuaJIT 2.1.1741730670

Any additional comments?

I'm creating a Chrome Extension and wanted to use vite build --watch - but it only triggered once on the initial build, and once again when saving each file.

Did some trial and error - and it works when using rollup.

The same issue did not appear when testing rolldown on Windows.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions