Skip to content

Commit 94046bb

Browse files
committed
fix sqljs module import - handle esm default export
1 parent c87d286 commit 94046bb

File tree

1 file changed

+4
-2
lines changed
  • public/jsonic-bench/src/adapters

1 file changed

+4
-2
lines changed

public/jsonic-bench/src/adapters/sqljs.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ export class SQLJSAdapter extends DatabaseAdapter {
2121

2222
async init() {
2323
// Load real SQL.js WASM library from CDN
24-
const initSqlJs = await import('https://cdn.jsdelivr.net/npm/[email protected]/dist/sql-wasm.js');
25-
const SQL = await initSqlJs.default({
24+
const module = await import('https://cdn.jsdelivr.net/npm/[email protected]/dist/sql-wasm.js');
25+
// Handle both ESM default export and UMD format
26+
const initSqlJs = module.default || module;
27+
const SQL = await initSqlJs({
2628
locateFile: file => `https://cdn.jsdelivr.net/npm/[email protected]/dist/${file}`
2729
});
2830

0 commit comments

Comments
 (0)