PGLite indexedDB migration error
hey everyone I'm trying to use PGlite with indexed db as a storage.
It seems like the migrate function has an error though:
Here's a snippet from my react app:
import * as schema from "./drizzle/schema.js";
.....
useEffect(() => {
const initDb = async () => {
const bufferDb = new PGlite("idb://test");
await bufferDb.waitReady;
const bufferDrizzle = drizzle(bufferDb, { schema });
const migrationPath = "./src/drizzle/migrations";
await migrate(bufferDrizzle, { migrationsFolder: migrationPath });
setDb(bufferDrizzle);
};
initDb();
}, []);
In the browser debug console:
Uncaught (in promise) TypeError: import_node_fs.default.existsSync is not a function
readMigrationFiles migrator.ts:40
migrate migrator.ts:9
initDb App.jsx:20
App2 App.jsx:24
React 8
workLoop scheduler.development.js:266
flushWork scheduler.development.js:239
performWorkUntilDeadline scheduler.development.js:533
js scheduler.development.js:571
js scheduler.development.js:633
__require chunk-LNEMQRCO.js:9
js index.js:6
__require chunk-LNEMQRCO.js:9
React 2
__require chunk-LNEMQRCO.js:9
js React
__require chunk-LNEMQRCO.js:9
js React
__require chunk-LNEMQRCO.js:9
<anonymous> react-dom_client.js:38
Is the migrate non compatible with pglite?
Thanks0 Replies