Closed tobiasmuecksch closed 2 years ago
@tobiasmuecksch
git clone https://github.com/tobiasmuecksch/capacitor-sqlite-angular
npm install
cd electron
npm install
npm run build
cd ..
npm run build
npx cap sync
npx cap sync @capacitor-community/electron
open the capacitor.config.ts
file and add the location for the electron databases
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'io.ionic.starter',
appName: 'sqlite-ionic',
webDir: 'www',
bundledWebRuntime: false,
plugins: {
CapacitorSQLite: {
electronWindowsLocation: 'CapacitorDatabases',
electronMacLocation: 'CapacitorDatabases',
electronLinuxLocation: 'CapacitorDatabases'
}
}
};
export default config;
and then
npm run build
npx cap copy
npx cap copy @capacitor-community/electron
cd electron
npm run electron:start
and that will do
@jepiqueau Thank you very much for your quick response. In fact that helped!
I've been following the readme.md here. I'd highly recommend you to add the information about the mandatory configuration in capacitor.config.ts
there.
P.S.: At the very top of the readme you said this
Databases location for Electron can be set in the config.config.ts as followed:
"CAN be set" means to me, that I don't have to, if I'm okay with the default config. If it's mandatory you should better phrase it like this:
Databases location for Electron MUST be set in the config.config.ts as followed:
@tobiasmuecksch i will have a look, there may be a bug there, i just changed all this in that release.
@jepiqueau I just found out, that when I run npx cap sync @capacitor-community/electron
the configuration in capacitor.config.ts
is automatically removed. That's quite confusing.
Describe the bug When I try to run my electron app, this exception is thrown:
To Reproduce Steps to reproduce the behavior:
git@github.com:tobiasmuecksch/capacitor-sqlite-angular.git
npm install && cd electron && npm install && cd ..
npx cap sync
npx cap sync @capacitor-community/electron
cd electron && npm run electron:start
Expected behavior No exception should be thrown, and electron should start as usual.
Desktop (please complete the following information):
Additional context