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
{{ message }}
Repository navigation
Add @electric-sql/pglite to NonBundleablePackages #75
PGlite locates pglite.data, pglite.wasm and initdb.wasm with new URL('./…', import.meta.url) and reads them from its own dist/ folder. When Nitro 3 bundles it, those files are not copied, and the first query fails:
ENOENT: no such file or directory, open '…/.output/server/_libs/pglite.data'
Repro with nitro 3.0.260903-beta (nf3 0.3.24), @electric-sql/pglite 0.5.8, Node 26:
// routes/index.tsimport{PGlite}from'@electric-sql/pglite'import{defineHandler}from'nitro/h3'exportdefaultdefineHandler(async()=>(awaitnewPGlite().query('select 1 as one')).rows)
nitro build, node .output/server/index.mjs, then GET / answers 500 with the error above.
With traceDeps: ['@electric-sql/pglite'] it answers [{"one":1}] (14 files traced, the data and wasm files included). PGlite's bundler docs expect some setup per bundler, so this is not a bug. But since the db already lists packages that cannot be bundled, could @electric-sql/pglite go in NonBundleablePackages, so it works without config? I can send a PR if that is the right list.
pglite is wasm. i think we should actually make a PR to it's package to add unwasm condition for proper nitro compatibility instead of force tracing it.
Activity
pi0 commentedon Oct 6, 2026
pglite is wasm. i think we should actually make a PR to it's package to add
unwasmcondition for proper nitro compatibility instead of force tracing it.