IO Error in packaged Electron app
See original GitHub issueI’m making an Electron app with LevelDB and want to use asar in packaging, but at startup it gives this error:
Uncaught Exception:
OpenError: IO error: ./hypershare.db/LOCK: No such file or directory
at /Users/gerhard/dev/node/hypershare-app/dist/Hypershare-darwin-x64/Hypershare.app/Contents/Resources/app.asar/node_modules/levelup/lib/levelup.js:119:34
at /Users/gerhard/dev/node/hypershare-app/dist/Hypershare-darwin-x64/Hypershare.app/Contents/Resources/app.asar/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16
I tried to unpack the file that creates the db, so it isn’t in the .asar
file, but it gives the same error.
If I don’t use asar it works though.
How could I avoid this error?
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Electron App Getting Exception While requiring SQLITE3
1) Your package.json is not well formated (there is no start script for example). New package.json { // there was no begining bracket ......
Read more >How to solve ERROR: IOError: could not spawn Electron?
This works: using VegaLite, VegaDatasets, ElectronDisplay dataset("cars") |> @vlplot(:point, x=:Acceleration, y=:Miles_per_Gallon, color=:Origin) #But this ...
Read more >Electron Installation - Developer Guides Overview
Use this doc to install Heap on Electron apps. For web installation instructions, see our web installation guide. ... After you npm install...
Read more >Electron
Learn how to use Sentry with Electron. ... the SDK cannot automatically inject preload scripts because the script will be missing from the...
Read more >How to use the electron-log.catchErrors function in ...
To help you get started, we've selected a few electron-log. ... catch and log unhandled errors/rejected promises: electronLog. ... Full package analysis ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, @ralphtheninja . Yeah, I found it. Actually @BrunoBernardino 's answer have solved my problem. Thanks, bro. But I did not notice that I run
electron:serve
and open the packaged app at the same time.@Alecyrus here’s the relevant code (sorry, that repo/app got sold and is no longer publicly available):
Basically the main problem here was PouchDB couldn’t access that app location, but electron can access the
appData
path, which will depend on the OS.I hope that helps!