#Electron app cannot find file in app.asar.unpacked even though it is there
20 messages · Page 1 of 1 (latest)
hmm ill give that a try
any idea why its not finding the file?
maybe mac m1 paths are weird
Well asar is a compression method
I wonder if it can't read it after the first open by electron
Paths on mac are case sensitive or not?
dont think so
i just tested out case sensitive paths
well original it was Error: ENOENT: no such file or directory, open 'app.asar.unpacked/myfolder/myfile
but i was trying diff paths sine i see the app structure for mac is
app/Content/Resources/app.asar.unpacked/
is app.asar.unpacked a regular folder?
i think its some magic from doing this in the electron builder json
"dist/electron/**/*",
"myfolder/myfile",
"myfolder/myfile2"
],
"asarUnpack": [
"myfolder/myfile",
"myfolder/myfile2"
],```
its trying to load these files in the main program
upon opening the app i get
Uncaught Exception:
Error: ENOENT: no such file or directory, open '/backend/MainProcess'
at Object.openSync (fs.js:476:3)
at Object.func [as openSync] (electron/js2c/asar_bundle.js:5:1846)
at Object.readFileSync (fs.js:377:35)
at Object.e.readFileSync (electron/js2c/asar_bundle.js:5:8872)
at evalmachine.<anonymous>:1:100109
at _0x41dfdd (evalmachine.<anonymous>:1:100528)
at App.<anonymous> (evalmachine.<anonymous>:1:103555)
at App.emit (events.js:315:20)```