forked from jsnbuchanan/crowd-funder-for-time-pwa
fix: resolve PWA build issues with SQL.js worker files
- Update worker format to ESM in Vite config to fix IIFE format error - Increase PWA precache file size limit to 10MB to accommodate SQL.js files - Fix type declarations for worker configuration - Add proper type annotations for Vite config - Add type declarations for absurd-sql module
This commit is contained in:
@@ -53,7 +53,7 @@ async function example() {
|
||||
[did, publicKeyHex]
|
||||
);
|
||||
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
console.error('Database operation failed:', error);
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ export class AbsurdSqlDatabaseService implements PlatformService {
|
||||
private static instance: AbsurdSqlDatabaseService | null = null;
|
||||
private db: AbsurdSqlDatabase | null = null;
|
||||
private initialized: boolean = false;
|
||||
|
||||
|
||||
// Singleton pattern
|
||||
static getInstance(): AbsurdSqlDatabaseService {
|
||||
if (!AbsurdSqlDatabaseService.instance) {
|
||||
@@ -101,7 +101,7 @@ export class AbsurdSqlDatabaseService implements PlatformService {
|
||||
async dbQuery(sql: string, params: unknown[] = []): Promise<QueryExecResult[]> {
|
||||
await this.waitForInitialization();
|
||||
return this.queueOperation<QueryExecResult[]>("query", sql, params);
|
||||
}
|
||||
}
|
||||
|
||||
async dbExec(sql: string, params: unknown[] = []): Promise<void> {
|
||||
await this.waitForInitialization();
|
||||
@@ -136,8 +136,8 @@ async function getAccount(did: string): Promise<Account | undefined> {
|
||||
}
|
||||
|
||||
return account;
|
||||
}
|
||||
```
|
||||
}
|
||||
```
|
||||
|
||||
## Success Criteria
|
||||
|
||||
|
||||
Reference in New Issue
Block a user