Feature request: Nitro 3 support (`unwasm` export condition)
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript, wasm
- Domain
- build-system
Research direction
Add the unwasm export condition to the root package.json exports field to map .wasm imports to the correct build output for Nitro 3 compatibility. Verify the fix by building a minimal Nitro 3 project that imports @electric-sql/pglite and confirming the server no longer throws a missing pglite.data error on the first query.
Written by the indexing model from the issue text.
Description
New feature request
Support for Nitro 3, the server engine of Nuxt 5 and others, without extra configuration.
A Nitro 3 build bundles PGlite, and the server then fails on the first query because pglite.data is not next to the bundle:
ENOENT: no such file or directory, open '…/.output/server/_libs/pglite.data'
Repro with nitro 3.0.260903-beta, @electric-sql/pglite 0.5.8, Node 26:
// nitro.config.ts
import { defineConfig } from 'nitro'
export default defineConfig({ serverDir: './' })
// routes/index.ts
import { PGlite } from '@electric-sql/pglite'
import { defineHandler } from 'nitro/h3'
export default defineHandler(async () => (await new PGlite().query('select 1 as one')).rows)
nitro build, node .output/server/index.mjs, then GET / answers 500 with the error above.
Describe the solution you'd like
Nitro's author suggested an unwasm export condition in PGlite's package, for proper Nitro compatibility. Nitro builds with that condition and handles .wasm imports through unwasm. Would you consider it?
- Dominant language
- TypeScript
- Stars
- 16.1k
- Forks
- 447
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from electric-sql/pglite
-
[BUG]: Parameter count higher than 16bit gets dropped silentlyPossibly taken @Aquiko claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
electric-sql/pglite#1118 ·
-
[BUG]: windowed live.query leaks its total-count prepared statement on unsubscribePossibly taken @askalf claimed this 24 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
electric-sql/pglite#1111 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
electric-sql/pglite#1048 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 72/100
electric-sql/pglite#1122 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
electric-sql/pglite#1116 ·
All issues in electric-sql/pglite
Similar issues
-
component:sight
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agentic-os-org/ANOLISA#6738 · 2 comments ·
Maintainers usually reply within 1 day
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mastra-ai/mastra#26470 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
paperclipai/paperclip#15630 ·
Maintainers usually reply within 1 day
-
[good first issue, hacktoberfest] ⛩️ Add new Theme: Sakura Latte (good-first-issue)Possibly taken @PGrayCS claimed this today. Opencommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
lingdojo/kana-dojo#31937 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
feature/cohorts feature/feature-flags team/feature-flags
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day