We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8bf5fd7 commit 84239b7Copy full SHA for 84239b7
.changeset/fix-better-sqlite3.md
@@ -0,0 +1,5 @@
1
+---
2
+"@powersync/node": patch
3
4
+
5
+Fix loading `better-sqlite3` on CommonJS builds.
packages/node/src/db/SqliteWorker.ts
@@ -84,7 +84,8 @@ export function startPowerSyncWorker(options?: Partial<PowerSyncWorkerOptions>)
84
},
85
async loadBetterSqlite3() {
86
const module = await dynamicImport('better-sqlite3');
87
- return module.default;
+ // require() gives us the default directly, for an ESM import() we need to use the default export.
88
+ return isBundledToCommonJs ? module : module.default;
89
90
...options
91
};
0 commit comments