Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'files' of undefined #53

Open
raghuram-periaswamy opened this issue Oct 3, 2017 · 3 comments
Open

TypeError: Cannot read property 'files' of undefined #53

raghuram-periaswamy opened this issue Oct 3, 2017 · 3 comments

Comments

@raghuram-periaswamy
Copy link

dir.files (recursively) throws an error if any one of the directories is empty.

stack trace:

node-dir/lib/paths.js:92
                results.files = results.files.concat(res.files);
wayou added a commit to wayou/node-dir that referenced this issue Mar 29, 2018
@blackarctic
Copy link

blackarctic commented May 29, 2019

This is still an issue on the latest version

Version:

Screen Shot 2019-05-29 at 4 42 10 PM

Code:

Screen Shot 2019-05-29 at 4 44 07 PM

Error:

Screen Shot 2019-05-29 at 4 43 02 PM

@eggplantzzz
Copy link

eggplantzzz commented Sep 25, 2019

I just confirmed that 0.1.17 still has this behavior.

Is this a problem that is likely to be fixed at some point? If not, does anyone else have any solutions or alternate libraries to use?

@YakovL
Copy link

YakovL commented Feb 5, 2023

What I've found is while dir.files(options.projectPath, { sync: true }) fails for me as described above, dir.files(options.projectPath, (error, files) => { ... }) works fine (although is not very convenient as it doesn't even return a promise, so one has to make their way around. It's a pity that such a popular library has such an annoying and long-standing bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants