electric-sql / electric-sql/pglite
[Bug] Bun bundle not work with PgLite
- Dominant language
- TypeScript
- Stars
- 16k
- Forks
- 442
- Avg merge
- 20h 19m
- Merged PRs (30d)
- 7
Description
**What versions are running ?**
- Bun: 1.1.33
- PgLite: 0.2.12
**What steps can reproduce the bug ?**
Use the following index.ts and package.json files and run
```bash
bun build --compile --sourcemap ./index.ts --outfile executable && ./executable
```
_index.ts_
```typescript
import { PGlite } from "@electric-sql/pglite";
const db = new PGlite();
await db.waitReady;
const result = await db.query("select 'Hello world' as message;");
console.log(result);
await db.close();
```
_package.json_
```json
{
"name": "pglite-bundle",
"private": true,
"module": "index.ts",
"type": "module",
"dependencies": {
"@electric-sql/pglite": "0.2.12"
}
}
```
**What is the expected behavior ?**
The process runs successfully.
**What do you see instead ?**
The process fails with error
```
ENOENT: No such file or directory
errno: -2
syscall: "open"
path: "/$bunfs/root/postgres.data"
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.