electric-sql / pglite

Lightweight WASM Postgres with real-time, reactive bindings.
https://pglite.dev
Apache License 2.0
8.36k stars 165 forks source link

fix(pglite): Fix Windows path resolution #54

Closed msfstef closed 6 months ago

msfstef commented 6 months ago

Fixes https://github.com/electric-sql/pglite/issues/34

The import.meta.url call resolves to a path that starts with a forward slash, that Windows cannot handle. (see https://github.com/nodejs/node/issues/37845)

Using the Node URL API to resolve a file URL to a path works, but I understand that the PGLite code works across multiple environments so either we need to polyfill this API or write our own implementation of something that works around this issue (like a very ugly regex?)