-
Notifications
You must be signed in to change notification settings - Fork 132
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
Cannot find database when launched in Electron #421
Comments
@saintsatplay2015 you just forgot to do after the run build to do |
@saintsatplay2015 By the way i usually update the package.json of the electron folder to:
So you delete the node_modules folder and the package-lock.json
|
@jepiqueau Thanks for your prompt reply, much appreciated. I made the changes that you suggested in the electron folder - deleting the node_modules and package.lock.json files, updating the package.json file to the dependencies and devDependencies that you listed and saved those before running npm install and npm run build. No problem there. Changing back to the parent ionic project root directory and running the following commands:
Unfortunately the same errors are still present. The app is launched but the electron develop console consistently displays the following: Does the Electron version need the jeep-sqlite plugin? I have not installed this, nor made any configurations relating to this, as I thought this applied purely to web only. |
I have noticed an issue with one of the node module dependency errors reported in the previous screen capture:
When I check the electron directory for this path I get the following:
The installed binding directory is napi-v6-darwin-x64 NOT napi-v6-darwin-arm64. Is this an issue related with MacOS Ventura/M1 chip MacBook architecture?? |
@saintsatplay2015 electron does not need jeep-sqlite component (only web). I do not have a M1 chip so it is certainly due to this as i tested on a ionic7 app and it works |
@jepiqueau Thanks for the reply. I have no doubts that the plugin works (I have used this many times in the previous 2 years and appreciate your contributions to the wider development community). So the issue relates to the incorrect architecture being installed or detected for the sqlcipher package when it comes to being installed on an M1 MacBook pro? Do you know of any workaround for this? I suspect this may become an issue for other M1 MacBook users (possibly even M2 chips too). |
@saintsatplay2015 |
@saintsatplay2015 I just find this sqlcipher-issue#413 |
@jepiqueau Thanks for the updates. I'll check these out and keep you informed as to progress with (hopefully) resolving this situation. To answer your previous question - I am not currently using database encryption and have no immediate plans to do so. I also appreciate that you might be caught between a rock and a hard place with the developer community and its requests so many thanks for your time and assistance. It does NOT go unappreciated believe me. |
Yes, I saw this yesterday. I also came across this which is probably not useful in the context of this plugin (but appears to relate to M1 chip related architecture issue): https://stackoverflow.com/questions/72553650/how-to-get-node-sqlite3-working-on-mac-m1 |
@saintsatplay2015 Was it working fine wit the release 4.6.3 on the M1 MacBook? Have you try running the 4.8.0 or 5.0.0 on a Intel based MacBook? is that working? |
@saintsatplay2015 If it works on Intel based MacBook can you rename the issue and 4.6.3 is not running on M1 MacBook, can you rename the issue M1 MacBook - Cannot find ... |
@jepiqueau installed and ran the Ionic 7/Angular/SQLite starter app. This runs fine on ionic serve in the browser. Running the following command:
Results in the following error thrown up in the console:
|
@saintsatplay2015 you should raise this issue in @journeyapps/sqlcipher |
@jepiqueau Will do - as I am also experiencing almost the same issue with the incorrect directory not being published on the following system with the Ionic 7/Angular/SQLite starter app:
In this instance, when running the However this time there is NO directory being generated in the location where the error occurs: I'll raise this will @journeyapps/sqlcipher and see what can be done. Will post updates here (as surely I can't be the only one experiencing this?) |
Raised an issue regarding this bug here: journeyapps/node-sqlcipher#111 |
@jepiqueau Thanks for your help - I appreciate this is NOT directly your issue (software dependencies can be such a headache to navigate). It doesn't seem like there's any recent development on the sqlcipher project (2 years ago was the last update) and response to user issues is patchy to say the least. That doesn't fill me with a lot of confidence for finding resolution to this issue (hopefully I'm wrong on this point). If there is no response from the maintainer(s) of the project what steps would you recommend going forwards to resolve this issue? I suspect that I can't be the only developer experiencing this with trying to create electron builds on Mac? |
@saintsatplay2015 i agree so that why i remove it 2years ago. But i was under the pressure of some developers to put it back. See if someone will look at it. Would may be i should look at 2 version one encrypted and one not? |
@jepiqueau I appreciate you're caught between a rock and a hard place with trying to satisfy various demands on your time (who would be a developer? :D) I'll keep you updated as to any possible response/progress from the SQL Cipher maintainer(s). In the meantime if you wouldn't mind acting on your suggestion - to look at one version encrypted and the other version unencrypted - maybe that will provide some insight?? It can't hurt right! Thanks once again for your prompt replies/assistance - they are greatly appreciated. |
Tried downgrading the version of sqlcipher in the electron package.json file down to 5.2.0:
|
Similar error to that with the latest version of SQL Cipher when downgrading to 5.3.0:
|
Hi, I'm experiencing the very same bug.
@jepiqueau |
I've also asked the developers to mark the project as abandoned journeyapps/node-sqlcipher#112 |
If you don't want to remove it; maybe you can change the code, that the |
@tobiasmuecksch this is what i am doing right now the developper will have the choice between sqlite3 without encryption and @journeyapps/sqlcipher with encryption i am not confident in using a code which is not maintained |
@jepiqueau Thank you so much! That's a great solution 😄 |
@saintsatplay2015 @tobiasmuecksch the new release 5.0.3 is doing this.
in the electron folder you must do
Can you test it and revert to me |
@jepiqueau I will get some time to test this over the next few days and let you know the outcome. Thanks for all your hard work and assistance with this issue - much appreciated! |
Updating |
@tobiasmuecksch i finally get some progress by defining a GH_TOKEN in github and modifying some files
now the npm run electron:make seems to finish successfully:
and now in the now when i installed and launched the app on the Mac i got an error:
and if i press on OK the application start normally if i go to the adress
So i do not know the reason why i got this error May be draft is not production |
Try to remove the |
Oh no, I just found out that |
✅ macOSBuilding and signing a ❌ windowsBut I'm still struggling with
|
@tobiasmuecksch i remove electron-rebuild and change "publish": [], it builds well but i still get the same error when launching is it because i do not have an Apple developer account? |
Yes, I'm working with a M1 MacBook Pro.
No, as the error states, it tries to read a json file from your repository.
Have you rebuilt and reinstalled the app, after changing the publish value to "never" ? |
Googling around didn't help me to find a solution. I've created an issue now here: m4heshd/better-sqlite3-multiple-ciphers#51 |
@tobiasmuecksch yes i did rebuild an reinstall the app |
@tobiasmuecksch Can you show me how did you set the publish:"never" on which file ? |
Well, in fact my publish config looks like this, because I'm using electron-updater to auto-update my app.
"publish": [
{
"provider": "generic",
"url": "https://updates.my-app.com/"
}
] But since you're not using the auto-update my guess was, that you should disable this. |
My problem is I'm running out of time, since I'm departing for a 1-week vacation tonight. Otherwise, I'd take a look at your app and help you to fix it. FYI: I got an answer on my build problem. It seems, that |
@tobiasmuecksch OK thanks for your help and have a good vacation time. I will keep you aware. |
@tobiasmuecksch Any news? |
Not yet. I'm struggling to build a windows package and haven't had the time yet to investigate it further. I will do so, as soon as possible. |
@jepiqueau Well, at least I've been able to build the latest Right now I'm still struggling with a setup to build the |
@tobiasmuecksch thanks for the news keep me aware on progress |
@jepiqueau Allright; I give up. Working in a parallels win11 machine has its problems. I cannot find out why, but when I run Then I said; okay - maybe it will work on a real win 10 machine. So I set up a win 10 machine with nodejs and what else you need to build the project. Anyways - losing cross platform build capability would also be a big minus point for Since |
As I found out, during the last update of electron-builder the reintroduced the error... |
A little update; there is still some discussion going on here: electron-userland/electron-builder#7652 maybe we don't have to give up on |
@jepiqueau Finally - success 🎉 I've been able to build and test I've even regained cross-building capabilities. I had to remove the |
@tobiasmuecksch i am happy of this as i did not know what i can do to help you. Better-sqlite3 claimed that it is far faster than sqlite3. It would be nice if you could write a doc on what you did so others can benefit from your hard work giving the electron package.json ... if you do it make a PR and i will merge it thanks for your work and contribution |
Sure. It'll take a few days, until I have time for that, but I will do that. |
@tobiasmuecksch When the doc is done i think we can close this issue |
@jepiqueau Well; I've investigated what in fact needs to be done to be able to build with the new better-sqlite3 package. Despite installing the dependencies you mentioned above it is only necessary to upgrade By the way; is it possible to integrate the dependencies like I'm now deploying this to the beta channel of my app in order to test if there are any issues which I didn't notice. |
@tobiasmuecksch OK il will mentioned it in the doc. No it is not possible the depencies which are required only for electron otherwise it will penalize the native part of the plugin where it is not needed |
All Right. I didn't know that. |
@tobiasmuecksch hope everything works well now with bettersqlite3. i will close the issue feel free to re-open it if require. Thanks for your contribution and support |
Describe the bug
Following errors are present when launching Ionic/Angular application with "@capacitor-community/sqlite": "^5.0.0" and "@capacitor-community/electron": "^4.1.2":
To Reproduce
Steps to reproduce the behavior:
Create the application in Ionic 7/Angular 16 using the following steps:
Expected behavior
I believe (perhaps incorrectly?) that I have imported the correct modules and followed the correct steps to be able to use the sqlite plugin within an Ionic 7 application launched as an Electron desktop app via the @capacitor-community/electron plugin.
When I perform a build and publish the application to electron for testing on my system using the following commands:
The project is built, with no errors in the Ionic CLI, and launched as an Electron application but multiple errors are reported in the developer console of the Electron browser environment - please see attached screenshots below.
Screenshots
The errors thrown up when the application is launched in an Electron environment:
The electron build source files that are present:
The capacitor configuration file copied to Electron on capacitor sync:

Desktop (please complete the following information):
Additional context
Package.json file:
Does the Electron version need to mirror the Web set up for SQLite and use the jeep-sqlite plugin?
I could not see anything in the Electron documentation for the SQLite plugin that stated this was a requirement yet the error, when published to Electron, seems to suggest that this is the case??
I just need to clarify that I haven't missed any vital steps in getting this plugin to work with Electron, that the documentation isn't incomplete or that there isn't a bug here.
It's likely a bone-headed mistake on my part but I really appreciate any help that can be provided here :)
The text was updated successfully, but these errors were encountered: