chokidar icon indicating copy to clipboard operation
chokidar copied to clipboard

Chokidar does not detect files containing the word "undefined"

Open brendon-stephens opened this issue 3 years ago • 0 comments

Describe the bug

Choidar does not detect files when the word "undefined" is contained within the file name.

Versions (please complete the following information):

  • Chokidar version: v3.5.3
  • Node version: v16.13.0
  • OS version: Ubuntu 18, Windows 10

To Reproduce:

  1. Create a folder named "upload" on the root directory.
  2. Create two files - one named "test.json" another named "undefined.json"
  3. Run the program below
  4. Copy both "test.json" and "undefined.json" to the upload directory
  5. Observe that only "test.json" is detected
const chokidar = require('chokidar');

const watcher = chokidar.watch('upload/*.json', {
    ignored: /(^|[\/\\])\../, // ignore dotfiles
    persistent: true
});

watcher.on('ready', () => console.log('Watching dir...'))
watcher.on('add', path => console.log(`File ${path} has been added`))
PS C:\Apps\Projects\Sandbox> node chokidar.js
Watching dir...
File upload\test.json has been added

Expected behavior The undefined.json file should be detected and notified via the 'add' event

brendon-stephens avatar Jun 08 '22 02:06 brendon-stephens