I’m getting the same error. though my function has the correct order of arguments.(dirname, ext, callback)… I keep getting that same error you have.
✗ Your additional module file [readdir.js] does not appear to pass back
an error received from fs.readdir(). Use the following idiomatic Node.js
pattern inside your callback to fs.readdir(): if (err) return
callback(err)