我用Vite Vue Ionic capacitor 5(最新版本)和SQLite构建了一个应用程序。我尝试用@capacitor-community/sqlite
实现包。在移动的模拟器上一切运行良好,但在浏览器jeep-sqlite.entry.js中未找到:
x1c 0d1x的数据
初始连接:
state() {
return {
platform: Capacitor.getPlatform(),
apiCon: null,
db: null,
dbdriver: new SQLiteConnection(CapacitorSQLite),
network: {
connected: false,
connectionType: "none",
},
};
}
applyPolyfills().then(() => {
jeepSqlite(window);
});
console.log("1");
// Create the 'jeep-sqlite' Stencil component
const jeepEl = await document.createElement("jeep-sqlite");
console.log("2");
await document.body.appendChild(jeepEl);
console.log("3");
await customElements.whenDefined("jeep-sqlite");
console.log("4");
// Initialize the Web store
await this.state.dbdriver.initWebStore();
console.log("5");
字符串
步骤1至4已运行。如何解决此问题?
1条答案
按热度按时间mbyulnm01#
我在Vite React离子电容器设置中遇到了同样的问题。您需要在vite.config.ts中将jeep-sqlite loader从optimize deps中排除:
字符串