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

@electric-sql/pglite does not work when bundled #17615

Closed
familyfriendlymikey opened this issue Feb 24, 2025 · 0 comments
Closed

@electric-sql/pglite does not work when bundled #17615

familyfriendlymikey opened this issue Feb 24, 2025 · 0 comments
Labels
bug Something isn't working bundler Something to do with the bundler

Comments

@familyfriendlymikey
Copy link

familyfriendlymikey commented Feb 24, 2025

What version of Bun is running?

1.2.3

What platform is your computer?

Darwin 23.5.0 arm64 arm

What steps can reproduce the bug?

File: ./test.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>test</title>
  </head>
  <body>
    <h1>test</h1>
    <script type="module" src="test.js"></script>
  </body>
</html>

File: ./test.js

import { PGlite } from '@electric-sql/pglite';
new PGlite();
console.log('PGlite initialized');

Terminal commands:

bun i @electric-sql/pglite
bun run test.html

What do you see instead?

Results in these console errors:

Bundled page in 44ms: test.html
frontend TypeError: Failed to fetch
      at Object.Rr [as r] (/Users/user/Desktop/repo/node_modules/@electric-sql/pglite/dist/chunk-EADU5A67.js:1:18054)
      at pe2.qe (/Users/user/Desktop/repo/node_modules/@electric-sql/pglite/dist/index.js:3:241582)
    from browser tab http://localhost:3000/

And this browser error:
Image

@familyfriendlymikey familyfriendlymikey added bug Something isn't working needs triage labels Feb 24, 2025
@paperclover paperclover added bundler Something to do with the bundler and removed needs triage labels Feb 24, 2025
@paperclover paperclover changed the title Issue with new bun run index.html (and wasm module?) @electric-sql/pglite does not work when bundled Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bundler Something to do with the bundler
Projects
None yet
Development

No branches or pull requests

2 participants