#Electron app cannot find file in app.asar.unpacked even though it is there

20 messages · Page 1 of 1 (latest)

dark tendon
#

Try using the extraResources option instead

#

That puts it outside the asar archive

velvet nymph
#

any idea why its not finding the file?

#

maybe mac m1 paths are weird

dark tendon
#

Well asar is a compression method

#

I wonder if it can't read it after the first open by electron

glad linden
#

Paths on mac are case sensitive or not?

velvet nymph
#

i just tested out case sensitive paths

glad linden
#

And path probably incorrect

#

Because they're is no /resource folder

velvet nymph
#

but i was trying diff paths sine i see the app structure for mac is

#

app/Content/Resources/app.asar.unpacked/

dark tendon
#

is app.asar.unpacked a regular folder?

velvet nymph
#

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)```