electric-sql / electric

Sync little subsets of your Postgres data into local apps and services.
https://electric-sql.com
Apache License 2.0
6.3k stars 149 forks source link

SQLite/PGLite not fully compatible with NextJS #1284

Closed stratospark closed 2 months ago

stratospark commented 5 months ago

Firstly, not sure if this is something that Electric can resolve or if I should direct this to NextJS/Turbopack maintainers.

I've been successfully using ElectricSQL sqlite with NextJS and webpack. The build times and HMR are getting really slow in my project so I tried migrating to Turbopack. This is failing to build.

Also, I tried to use PGLite with and without Turbopack. It is not working within NextJS either way.

I've added a repo to reproduce these issues here: https://github.com/stratospark/turbopack-test

linear[bot] commented 5 months ago

VAX-1873 SQLite/PGLite not fully compatible with NextJS

stratospark commented 5 months ago

I've added an issue to the NextJS repo in case they have more clues: https://github.com/vercel/next.js/issues/66005

samwillis commented 5 months ago

Thanks for the report @stratospark, I shall take a look and see that's happing. My first guess is that this is related to bundling and loading the WASM binaries.

stratospark commented 4 months ago

Turbopack maintainers found a probable cause and are working on a fix: https://github.com/vercel/next.js/issues/66005#issuecomment-2129250567

That would leave the pglite/webpack option the main thing to resolve at the moment.

KyleAMathews commented 2 months ago

👋 we've been working the last month on a rebuild of the Electric server over at a temporary repo https://github.com/electric-sql/electric-next/

You can read more about why we made the decision at https://next.electric-sql.com/about

We're really excited about all the new possibilities the new server brings and we hope you'll check it out soon and give us your feedback.

We're now moving the temporary repo back here. As part of that migration we're closing all the old issues and PRs. We really appreciate you taking the time to investigate and report this issue!