Can't build project (CRA + Cap 3 + sqlite)
See original GitHub issueDescribe the bug
Started with a simple create-react-app and installed Capacitor in it (v3). ios
platform works fine, but I can’t get the electron
platform working after adding the sqlite community plugin. Am I missing something or using the wrong version somewhere?
Looking at the sqlite plugin docs, it looks like they might not be ready for Electron + Capacitor v3 yet … is there a way to specify that I only want to use this plugin for iOS/Android and not for Electron?
To Reproduce
$ npx create-react-app react-electron --template typescript
$ cd react-electron/
$ yarn add @capacitor/core @capacitor/cli
$ npx cap init
$ yarn add @capacitor/ios
$ npx cap add ios
# all good ✅
$ yarn add @capacitor-community/electron
$ npx cap add @capacitor-community/electron
$ npx cap open @capacitor-community/electron
# all good ✅
$ yarn add @capacitor-community/sqlite
$ npx cap sync @capacitor-community/electron
✔ Copying Web App to Electron platform in 32.38ms
⠋ Updating Electron plugins
Will install: @capacitor-community/sqlite@3.0.0
✔ Updating Electron plugins in 8.19s
# all good ✅
$ npx cap doctor @capacitor-community/electron
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 3.1.0
@capacitor/core: 3.0.2
@capacitor/android: 3.0.2
@capacitor/ios: 3.1.0
Installed Dependencies:
@capacitor/android: not installed
@capacitor/cli: 3.1.0
@capacitor/core: 3.0.2
@capacitor/ios: 3.1.0
[error] Invalid platform: @capacitor-community/electron
# this is strange 🤔
$ cd electron
$ npm run electron:start
> react-electron@1.0.0 electron:start /Users/agonzalezjr/code/react-electron/electron
> npm run build && electron ./
> react-electron@1.0.0 build /Users/agonzalezjr/code/react-electron/electron
> tsc
CapacitorCommunitySqlite
CapacitorSQLite
["isSecretStored","setEncryptionSecret","changeEncryptionSecret","createConnection","closeConnection","echo","open","close","execute","executeSet","run","query","isDBExists","isDBOpen","isDatabase","isTableExists","deleteDatabase","isJsonValid","importFromJson","exportToJson","createSyncTable","setSyncDate","getSyncDate","addUpgradeStatement","copyFromAssets","getDatabaseList","addSQLiteSuffix","deleteOldDatabases","checkConnectionsConsistency"]
(node:13008) UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object
at Function.getOwnPropertyNames (<anonymous>)
at Object.setupCapacitorElectronPlugins (/Users/agonzalezjr/code/react-electron/electron/node_modules/@capacitor-community/electron/dist/core/util.js:98:41)
at ElectronCapacitorApp.init (/Users/agonzalezjr/code/react-electron/electron/build/src/index.js:102:20)
at /Users/agonzalezjr/code/react-electron/electron/build/src/index.js:127:26
(Use `Electron --trace-warnings ...` to show where the warning was created)
(node:13008) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:13008) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Issue Analytics
- State:
- Created 2 years ago
- Comments:53 (15 by maintainers)
Top Results From Across the Web
How To Compile SQLite
Building SQLite directly from individual source code files is certainly possible, but it is not recommended. For some specialized applications, ...
Read more >Deploying CAP services with the in-memory SQLite database
Today I will show you how you can deploy a CAP service to Cloud Foundry while using the in-memory SQLite database.
Read more >c++ - I have problems with sqlite3
I'm pretty new to programming and i have never made any big project. Currently I'm learning c++ language and I want to learn...
Read more >Building an SQLite Ionic App with Capacitor
In this tutorial we will integrate the Capacitor community SQLite plugin and build a powerful app that first of all loads some seed...
Read more >Using Databases - SAP Capire
CSV files in your project are picked up by deployments for both SQLite and SAP HANA ... On SAP HANA, only use CSV...
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
@IT-MikeS Thanks, I will try tomorrow for me i have done too much computer today
Will do. In an hour I or so I can report back 😃