You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Framework7 + Svelte. How do I make this run on a web for testing purpose using jeep-sqlite?
I don't see any document about this anywhere.
I have tried:
// @ts-nocheckimportAppfrom'./app.svelte';// Framework7 Dependenciesimport'framework7/css/bundle';importFramework7from'framework7/lite-bundle';importFramework7Sveltefrom'framework7-svelte';//SQlite Databaseimport{defineCustomElementsasjeepSqlite,applyPolyfills}from'jeep-sqlite/loader';import{Capacitor}from'@capacitor/core';import{CapacitorSQLite,SQLiteConnection,SQLiteDBConnection}from'@capacitor-community/sqlite';// Init F7 Svelte PluginFramework7.use(Framework7Svelte);//DEV: Make SQlite usage for the WEB (Testing purposes)applyPolyfills().then(()=>{jeepSqlite(window);});window.addEventListener("DOMContentLoaded",async()=>{console.log("CALL HERE!");constplatform=Capacitor.getPlatform();constsqlite: SQLiteConnection=newSQLiteConnection(CapacitorSQLite)try{if(platform==="web"){// Create the 'jeep-sqlite' Stencil componentconstjeepSqlite=document.createElement('jeep-sqlite');document.body.appendChild(jeepSqlite);awaitcustomElements.whenDefined('jeep-sqlite');// Initialize the Web storeawaitsqlite.initWebStore();}}catch(err){console.log(`Error: ${err}`);thrownewError(`Error: ${err}`)}});constapp=newApp({target: document.getElementById("app"),});exportdefaultapp;
But it still doesn't work. I got error in the console:
Failed to initialize database, Error: The jeep-sqlite element is not present in the DOM! Please check the @capacitor-community/sqlite documentation for instructions regarding the web platform. at CapacitorSQLiteWeb.ensureJeepSqliteIsAvailable (web.ts:538:13) at CapacitorSQLiteWeb.copyFromAssets (web.ts:494:10) at runtime.js:95:35 at async SQLiteConnection.copyFromAssets (definitions.ts:1677:7) at async initializeAppDatabase (database.ts:13:5)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using
Framework7
+Svelte
. How do I make this run on a web for testing purpose usingjeep-sqlite
?I don't see any document about this anywhere.
I have tried:
But it still doesn't work. I got error in the console:
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions