You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently trying to create a worker so i can access the "proxy" via different workers.
appearently the worker class mismatches with the source?
because postMessage, addEventListener is not available
more main process logs:
(node:34988) UnhandledPromiseRejectionWarning: TypeError: a(...).addEventListener is not a function
at (redacted)\node_modules\@electric-sql\pglite\dist\worker\index.cjs:8:3552
at new Promise (<anonymous>)
at new Ee ((redacted)\node_modules\@electric-sql\pglite\dist\worker\index.cjs:8:3526)
at createDatabaseWorker ((redacted)\out\main\json-IHKDEz9o.js:916:14)
at Object.<anonymous> ((redacted)\out\main\json-IHKDEz9o.js:923:16)
at Module._compile (node:internal/modules/cjs/loader:1484:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1564:10)
at Module.load (node:internal/modules/cjs/loader:1295:32)
at Module._load (node:internal/modules/cjs/loader:1111:12)
at c._load (node:electron/js2c/node_init:2:16955)
Source:
// my-pglite-worker.tsimport{PGlite}from'@electric-sql/pglite'import{worker}from'@electric-sql/pglite/worker'import{parentPort}from'worker_threads'constport=parentPortif(!port)thrownewError('IllegalState')worker({asyncinit(options){constmeta=options.meta// Do something with additional metadata.// or even run your own code in the leader along side the PGlitereturnnewPGlite({dataDir: options.dataDir})}})
after looking through the source, it seems pglite expects a "Web" Worker, so i tried to make a polyfill but due to pglite worker's source that requires navigator and tabChannel to exist this wont do :/
i guess this turns into a request to support node's "worker_threads"?
Yes, we should 100% create a PGliteWorker for use with Node and electron. I suspect it would want to be a separate import, maybe sharing some RPC code. It's on the list!
currently trying to create a worker so i can access the "proxy" via different workers.
appearently the worker class mismatches with the source?
because postMessage, addEventListener is not available
more main process logs:
Source:
The text was updated successfully, but these errors were encountered: