Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

I am trying to run SQLite on the web using Ionic Angular, but I encounter this error right after initializing SQLite.

Đang mở
#652 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
28/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
angular, sqlite, typescript, wasm
Lĩnh vực
databases, web-dev

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện quá trình khởi tạo web, đồng thời so sánh hướng dẫn Ionic Angular SQLite được liên kết với các phiên bản Angular, Ionic, Capacitor và plugin đã được báo cáo. Kiểm tra InitializeAppService.initializeApp và phần thiết lập jeep-sqlite được thể hiện trong bootstrap code, sau đó xác minh liệu lỗi WASM có xảy ra trước khi sử dụng cơ sở dữ liệu hay không. Công việc hoàn tất khi trình duyệt khởi tạo SQLite mà không có LinkError đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug/fix needs: triage

i am following this side and i do exact every step from this side
(https://jepiqueau.github.io/2023/08/26/Ionic7Angular-SQLite-CRUD-App.html#part-1---web---table-of-contents)

Plugin version:
{
"name": "ionic7-angular-sqlite-app",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"lint": "ng lint",
"ionic:serve:before": "npm run copy:sql:wasm",
"copy:sql:wasm": "copyfiles -u 3 node_modules/sql.js/dist/sql-wasm.wasm src/assets"
},
"private": true,
"dependencies": {
"@angular/animations": "^20.0.0",
"@angular/common": "^20.0.0",
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/forms": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@angular/platform-browser-dynamic": "^20.0.0",
"@angular/router": "^20.0.0",
"@capacitor-community/sqlite": "^7.0.1",
"@capacitor/app": "7.0.1",
"@capacitor/core": "7.4.2",
"@capacitor/haptics": "7.0.1",
"@capacitor/keyboard": "7.0.1",
"@capacitor/status-bar": "7.0.1",
"@capacitor/toast": "^7.0.1",
"@ionic/angular": "^8.0.0",
"@ionic/pwa-elements": "^3.3.0",
"ionicons": "^7.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
},

Platform(s):

Current behavior:
chunk-SCNEKAWF.js:58 wasm streaming compile failed: LinkError: WebAssembly.instantiate(): Import #34 "a" "I": function import requires a callable

chunk-SCNEKAWF.js:58 falling back to ArrayBuffer instantiation

chunk-SCNEKAWF.js:58 failed to asynchronously prepare wasm: LinkError: WebAssembly.instantiate(): Import #34 "a" "I": function import requires a callable

chunk-SCNEKAWF.js:58 Aborted(LinkError: WebAssembly.instantiate(): Import #34 "a" "I": function import requires a callable)

chunk-SCNEKAWF.js:58 ERROR Error: LinkError: WebAssembly.instantiate(): Import #34 "a" "I": function import requires a callable

chunk-SCNEKAWF.js:58 ERROR RuntimeError: Aborted(LinkError: WebAssembly.instantiate(): Import #34 "a" "I": function import requires a callable). Build with -sASSERTIONS for more info.

Expected behavior:

Steps to reproduce:

Related code:
import { enableProdMode, importProvidersFrom, APP_INITIALIZER } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import { IonicModule } from '@ionic/angular';

import { RouteReuseStrategy, provideRouter, withPreloading, PreloadAllModules } from '@angular/router';
import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular/standalone';

import { routes } from './app/app.routes';
import { AppComponent } from './app/app.component';
import { environment } from './environments/environment';
import { defineCustomElements as pwaElements } from '@ionic/pwa-elements/loader';
import { defineCustomElements as jeepSqlite } from 'jeep-sqlite/loader';
import { Capacitor } from '@capacitor/core';
import { InitializeAppService } from './app/services/initialize.app.service';
import { SQLiteService } from './app/services/sqlite.service';
import { StorageService } from './app/services/storage.service';
import { DbnameVersionService } from './app/services/dbname-version.service';

if (environment.production) {
enableProdMode();
}
// --> Below only required if you want to use a web platform
const platform = Capacitor.getPlatform();
if (platform === "web") {
// Web platform
// required for toast component in Browser
pwaElements(window);

// required for jeep-sqlite Stencil component
// to use a SQLite database in Browser
jeepSqlite(window);

window.addEventListener('DOMContentLoaded', async () => {
const jeepEl = document.createElement("jeep-sqlite");
document.body.appendChild(jeepEl);
await customElements.whenDefined('jeep-sqlite');
jeepEl.autoSave = true;
});
}
// Above only required if you want to use a web platform <--

// Define the APP_INITIALIZER factory
export function initializeFactory(init: InitializeAppService) {
return () => init.initializeApp();
}

bootstrapApplication(AppComponent, {
providers: [
SQLiteService,
InitializeAppService,
StorageService,
DbnameVersionService,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
importProvidersFrom(IonicModule.forRoot({})),
provideIonicAngular(),
provideRouter(routes, withPreloading(PreloadAllModules)),
{
provide: APP_INITIALIZER,
useFactory: initializeFactory,
deps: [InitializeAppService],
multi: true
}
],
});

insert short code snippets here

Other information:

Capacitor doctor:

insert the output from `npx cap doctor` here
Ngôn ngữ chính
Swift
Star
661
Fork
158
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của capacitor-community/sqlite

Tất cả issue của capacitor-community/sqlite

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.