jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.43k stars 775 forks source link

Issue upgrading to 11.2.0 #1029

Closed u01jmg3 closed 9 months ago

u01jmg3 commented 9 months ago

Ubuntu 22.04

20.5.1

11.2.0


[webpack-cli] TypeError: Cannot use 'in' operator to search for 'clobber' in 0
    at Object.copy (/home/runner/work/github-actions/github-actions/laravel/node_modules/fs-extra/lib/copy/copy.js:15:28)
    at Object.copy (/home/runner/work/github-actions/github-actions/laravel/node_modules/universalify/index.js:22:13)
    at /home/runner/work/github-actions/github-actions/laravel/webpack.mix.js:47:16
    at new Promise (<anonymous>)
    at /home/runner/work/github-actions/github-actions/laravel/webpack.mix.js:46:16
    at /home/runner/work/github-actions/github-actions/laravel/node_modules/laravel-mix/src/Dispatcher.js:39:62
    at Array.map (<anonymous>)
    at Dispatcher.fire (/home/runner/work/github-actions/github-actions/laravel/node_modules/laravel-mix/src/Dispatcher.js:39:47)
    at Mix.dispatch (/home/runner/work/github-actions/github-actions/laravel/node_modules/laravel-mix/src/Mix.js:248:32)
    at Mix.init (/home/runner/work/github-actions/github-actions/laravel/node_modules/laravel-mix/src/Mix.js:134:21)
RyanZim commented 9 months ago

It looks like somehow 0 might be being passed as an opts parameter, which is an invalid value. Previous releases ignored falsey values due to this line: https://github.com/jprichardson/node-fs-extra/blob/6f2b2bc9958954f127e9974b7f2d31ba09e703b2/lib/copy/copy.js#L19 However, the latest release now uses default parameters, which only check for undefined: https://github.com/jprichardson/node-fs-extra/blob/5d4bf0b1b9886a2842949aded25c8a16b5d39452/lib/copy/copy.js#L10

So it looks like this change is highlighting a long-standing bug in your code.

u01jmg3 commented 9 months ago

Thanks for pointing me in the right direction. Found the culprit. Appreciate your time.