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

Electron version struggles with app.asar #1523

Open
victorbnl opened this issue Jul 12, 2022 · 1 comment
Open

Electron version struggles with app.asar #1523

victorbnl opened this issue Jul 12, 2022 · 1 comment

Comments

@victorbnl
Copy link
Contributor

victorbnl commented Jul 12, 2022

I'm running the electron version and ungit crashes if there is an app.asar (seems to depend on which app.asar it is, and where the file is located) in the folder

2022-07-12T12:21:29.676Z - error: Error: ENOTDIR: not a directory, watch '/home/victor/ungit-electron/src/ungit-linux-x64/resources/app.asar/assets'
    at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
    at Object.watch (node:fs:2251:34)
    at /home/victor/ungit-electron/ungit-linux-x64/resources/app.asar/node_modules/node-watch/lib/watch.js:398:22
    at hasNativeRecursive (/home/victor/ungit-electron/ungit-linux-x64/resources/app.asar/node_modules/node-watch/lib/has-native-recursive.js:61:12)
    at Watcher.watchDirectory (/home/victor/ungit-electron/ungit-linux-x64/resources/app.asar/node_modules/node-watch/lib/watch.js:381:3)
    at /home/victor/ungit-electron/ungit-linux-x64/resources/app.asar/node_modules/node-watch/lib/watch.js:414:16
    at /home/victor/ungit-electron/ungit-linux-x64/resources/app.asar/node_modules/node-watch/lib/watch.js:143:35
    at Array.forEach (<anonymous>)
    at /home/victor/ungit-electron/ungit-linux-x64/resources/app.asar/node_modules/node-watch/lib/watch.js:141:13
    at node:electron/js2c/asar_bundle:5:461

It seems to believe app.asar is a directory, which as an assets subdirectory, while it's a file

Reproduce

  1. Download and extract ungit's latest release
  2. Try to open the parent folder containing the extracted release, with ungit electron

Simple Linux command for the above

mkdir test && cd test && wget 'https://github.com/FredrikNoren/ungit/releases/download/v1.5.21/ungit-1.5.21-linux-x64.zip' && unzip ungit-1.5.21-linux-x64.zip && ungit-linux-x64/ungit
@campersau
Copy link
Collaborator

electron monkey patches the fs APIs to transparently support reading files from asar archives (asar is similar to zip) which interfers with node-watch.

Related upstream bug yuanchuan/node-watch#108

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

2 participants