rollup / rollup-watch

Fast incremental rebuilds with Rollup CLI
MIT License
91 stars 23 forks source link

Rollup-watch only "sees" the first change #4

Closed jaap3 closed 8 years ago

jaap3 commented 8 years ago

Using vi as my editor on OSX only the first change to a file is picked up by rollup-watch.

While testing this I also had rollup-watch crash:

Error: ENOENT: no such file or directory, open '/path/to/file.js'
    at Error (native)
    at Object.fs.openSync (fs.js:634:18)
    at Object.fs.readFileSync (fs.js:502:33)
    at FSWatcher.<anonymous> (/path/to/node_modules/rollup-watch/dist/rollup-watch.cjs.js:49:21)
    at emitTwo (events.js:106:13)
    at FSWatcher.emit (events.js:191:7)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1406:12)

Seems that a save in vi doesn't "update" the original file. Instead the original is removed an replaced by a new file with the modified content.

Was able to reproduce this also using WebStorm IDE. Was not able to reproduce this using nano or atom.

jaap3 commented 8 years ago

Seems that this is due to the (expected) behaviour of fs.watch (https://nodejs.org/docs/latest/api/fs.html#fs_inodes)

Rich-Harris commented 8 years ago

Thanks – this should be fixed in 2.3.0. Reopen if not!

jaap3 commented 8 years ago

I can confirm this is fixed, thanks!

1000hz commented 7 years ago

I'm seeing this happen again with rollup-watch@3.2.2. Can reproduce with TextMate2, but not with Atom. It builds once when I start the watch, builds once more after I save a file, and then any subsequent changes to that file no longer trigger a build.

farwayer commented 7 years ago

I can confirm. It happens with Intellij IDEA

Ramblurr commented 7 years ago

I also can reproduce this with Intellilj IDEA. It's quite a PITA as I have to constantly Ctrl+C rollup and restart it.

lcanet commented 7 years ago

In system settings, under "synchronization", try disabling the "safe write" feature

bertday commented 6 years ago

I'm seeing this as well. My text editor is Sublime, not IntelliJ. Rollup starts up and watches fine, and then the first change will throw an ENOENT: no such file error for bootstrap-vue files (while I'm not editing, just importing).

Tommos0 commented 6 years ago

Also having this issue, maybe reopen it?

Niklan commented 6 years ago

Looks loke I have the same problem with PhpStorm.

As @lcanet mentiod, File - Settings - Appearance & Behavior - System Settings - Synchronization - uncheck Use "safe write" seems to fix issue for now.

But it strange. First change is always visible to rollup, but all consecutive is ignored.