Closed ashrielbrian closed 1 month ago
I think this Emscripten patch should fix it. https://github.com/emscripten-core/emscripten/pull/22605/files
0.2.10 should build with newer emscripten, did it fix the problem ?
0.2.10 should build with newer emscripten, did it fix the problem ?
Looks like it was still pre-patch. Line 321 of dist/postgres.js
still shows the old notation that messes with webpack:
https://www.npmjs.com/package/@electric-sql/pglite?activeTab=code
The patch we need was introduced to Emscripten in commit 543993ecf6fbf1c97c2ed56d062dc504978962c3
:
https://github.com/emscripten-core/emscripten/commit/543993ecf6fbf1c97c2ed56d062dc504978962c3
I'm seeing this working with Webpack and PGlite v0.2.11.
I am using Plasmo to build a Chrome extension with
pglite
as the persistent data store running in a background worker.Backing plasmo is, I believe, a node server running a live hot reload for each new change. However, when I try to load pglite in my background worker script, i.e.
I get the errors:
Looking into
postgres.js
I believe the culprit is on line 318:I removed
"./"
:and it was able to find the modules correctly. This was something that only occurred specifically with
pglite
, and not other modules/packages I had installed.Versions: