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

empty folder causes error #5

Open
andreawyss opened this issue Mar 22, 2018 · 4 comments
Open

empty folder causes error #5

andreawyss opened this issue Mar 22, 2018 · 4 comments

Comments

@andreawyss
Copy link

If an empty folder exists inside the recursed structure it causes this error:

node_modules/node-dir/lib/paths.js:92
results.files = results.files.concat(res.files);

TypeError: Cannot read property 'files' of undefined
at subloop (/git/mobile.reactnative.templateapp/node_modules/node-dir/lib/paths.js:92:57)
at /git/mobile.reactnative.templateapp/node_modules/node-dir/lib/paths.js:107:13

Error reproduced on MAC with node 6 and node 8

@busegenc
Copy link

I had the same error. Removing empty folders fixes the problem.

@tusharkotlapure
Copy link

Is there any permanent fix for this issue?

@sebinsua
Copy link

sebinsua commented Feb 4, 2020

@tusharkotlapure Don't use this package. Use node-require-context.

@mgd216
Copy link

mgd216 commented May 21, 2020

I had the same issue, did not realize another dev had removed files in a directory and it was empty. Took a while to use the debugger to find out the dependency node-dir throws an error on an empty folder. On node-dir/lib/paths.js line 86 would add a check: if (res && type ==='combine') .

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

5 participants