Loading PGlite fails #1827
Unanswered
balazskosi
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Thanks. I'm not sure how to fix this, but here's another solution, which does not require patching the code: ```js echo
import {PGlite} from "npm:@electric-sql/pglite/dist/index.js"
const db = await PGlite.create();
```
```js
display(await db.query("SELECT 'Hello world' as message;"))
``` |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Results in:
The preview console writes:
What is right, because
postgres.data
is athttps://cdn.jsdelivr.net/npm/@electric-sql/[email protected]/dist/postgres.data
not athttps://cdn.jsdelivr.net/npm/@electric-sql/[email protected]/postgres.data
(note the/dist
).When downloading with npm and using on the server side it works
I've made it work patching the path in the downloaded files.
It references the file like this:
e=new URL("./postgres.data",import.meta.url);
Is this a problem with the
pglite
package, with the import code or the way I am importing it?Beta Was this translation helpful? Give feedback.
All reactions