chokidar: Watching network drive '\\server\folder' does not work

Hi I have a problem where chokidar does not report changes to network shared folder, i.e. \\\\file.server.net\\dev\\7500. Using fs.writeFile() on that folder works fine and a file gets created by Node. Iโ€™m under Win10. My config is below. I tried both with usePolling true and false, no change. I donโ€™t get any errors, just changes to network folder donโ€™t get reported. Watching a folder on local drive C:\db works fine. Watching that network drive using drive letter path format actually works too s:\\dev\\7500. Iโ€™d prefer to use server path notation in case drive mapping letters get changed in future, or some users in the company have different letters mapped.

Do you see anything amiss in my setup?

fs.writeFile('\\\\file.server.net\\dev\\7500\\test.txt', 'this file gets created OK', (err) => {
  if (err) throw err
})

const chokidarOptions = {
  persistent: true,
  // ignored: "*.txt",
  ignoreInitial: false,
  followSymlinks: true,
  cwd: ".", 
  disableGlobbing: false,
  usePolling: true, // tried with false as well
  interval: 1000,
  binaryInterval: 3000,
  alwaysStat: false,
  depth: 99,
  awaitWriteFinish: {
    stabilityThreshold: 2000,
    pollInterval: 100,
  },
  ignorePermissionErrors: true, // watch files that don't have read permissions
  atomic: true, // or a custom 'atomicity delay', in milliseconds (default 100)
};

const optionsFileMonitor = {
  watchFolders: ["\\\\file.server.net\\dev\\7500", "s:\\dev\\7500", "C:/db"]
};

const fileMonitor = chokidar
  .watch(optionsFileMonitor.watchFolders, chokidarOptions)
  .on("all", (event, epath) => {
    console.log(event, path.resolve(epath));
})

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 20 (8 by maintainers)

Most upvoted comments

@paulmillr I think this issue should not be closed while there is no new chokidar release available via npm that includes the fix provided by @whyboris. BTW: Thanks a lot for your work on chokidar ๐Ÿ‘ ๐Ÿ™

@whyboris try doing this and see if tests fail on any platform

No status. Feel free to debug this and provide a pull req.

I too had this problem
downgrading to chowkidar@3.1.1 solves for me.

Bump

PR to solve the problem ๐Ÿคž #1025 ๐Ÿ˜

Changing to @3.1.1 worked for me

I have the exact same issue as Zireal, watching a folder on our network drive does not work on Windows 10. I tried with fs.watch, it does work.

I downgraded to 3.1.1, it does not fix the issue.