isaacs / node-graceful-fs

fs with incremental backoff on EMFILE
ISC License
1.27k stars 148 forks source link

Incompatible with Electron v10.x.y+ when dealing with .asar #223

Open htxuuu opened 2 years ago

htxuuu commented 2 years ago

when Electron dealing with directory with .asar, will directly access options.withFileType. See: https://github.com/electron/electron/blob/4594af595eab12e76034d0d0e94539ef390024bb/lib/common/asar.js#L597

and in graceful-fs v4.2.7 and above, will set options to null in some circumstances. For example: https://github.com/isaacs/node-graceful-fs/blob/9ec3413c8eb1c073c42262bf5a2a8cdf556f68a7/graceful-fs.js#L113

when options sets to null, options.withFileTypes in Electron will cause error.

I suppose it is a bug.

htxuuu commented 2 years ago

currently I use yarn and set:

"resolutions": {
    "graceful-fs": "4.2.6"
 }

in package.json to lock graceful-fs in v4.2.6

jarrodek commented 2 years ago

I have a similar issue. The options = null should be replaced with options = undefined because null cannot be replaced with default parameters. Because of that, I am having trouble running my electron application. I see errors with this module.