-
Notifications
You must be signed in to change notification settings - Fork 231
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
Improve error with pointer to docs when PGlite is unable to load WASM binary #199
Comments
That looks like a WASM problem. Are you using vite and not excluding it from the optimisations?
|
Yes, adding this to the import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
optimizeDeps: {
exclude: ['@electric-sql/pglite'],
},
}); |
Although this is due to a bundler and outside of PGlite, we should try and improve the error message here, to indicate what the fix is. |
😅 that is exactly what I was doing. I had no idea I had to exclude it from optimisations. Yeah, a better error message would be amazing, but it does work now! Thanks! |
I have a similar issue with Next.js:
I have try to apply a similar change like in Vite
PGlite works perfectly with the in-memory FS and it didn't work with Node FS. So, I don't have any issue with the in-memory version, the issue is only with the Node FS. Any idea? |
Possibly related #322 (comment) |
@lirbank I also applied serverComponentsExternalPackages (I'm currently at Next.js 14) to make it work. It working with the in-memory FS: https://pglite.dev/docs/filesystems#in-memory-fs In your case, does it work with https://pglite.dev/docs/filesystems#node-fs? |
@ixartz got it. I have not tried the node-fs. I am just using PGllite in the browser for now, so I am afraid I can't help. But I am curious to use it for tests on the server at some point. |
@lirbank On my side, I didn't have the chance to try in the browser, I'm currently using for local/dev environment with PGLite. I also use for testing. If you are interested, you can take a look at: https://github.com/ixartz/SaaS-Boilerplate |
#199 (comment) fixed it for me as well, but I never got any error messages (in Safari), my |
I'm getting an error when running a transaction in the browser. The function I'm running:
The error:
The text was updated successfully, but these errors were encountered: