Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Bun bundle not work with PgLite #414

Open
esciullo opened this issue Nov 6, 2024 · 1 comment
Open

[Bug] Bun bundle not work with PgLite #414

esciullo opened this issue Nov 6, 2024 · 1 comment

Comments

@esciullo
Copy link

esciullo commented Nov 6, 2024

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

bun build --compile --sourcemap ./index.ts --outfile executable && ./executable

index.ts

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

{
  "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"
@pmp-p
Copy link
Collaborator

pmp-p commented Nov 6, 2024

/$bunfs/root/postgres.data is a bun generated path and it is wrong.
Just dont use compile until they fix packager ( afaik there are open issues already https://github.com/oven-sh/bun/issues?q=is%3Aissue%20%2F%24bunfs%2Froot )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants