electric-sql / pglite

Lightweight WASM Postgres with real-time, reactive bindings.
https://pglite.dev
Apache License 2.0
9.49k stars 204 forks source link

v0.2.8 and v0.2.9 - Module not found: Can't resolve 'fs/promises' #355

Closed lirbank closed 1 month ago

lirbank commented 1 month ago

I tried to upgrade @electric-sql/pglite from 0.2.7 to 0.2.8 yesterday, and then again today to 0.2.9, with the same result.

Here is the build output:

> next build 

  ▲ Next.js 15.0.0-canary.161
  - Environments: .env

   Creating an optimized production build ...
Failed to compile.

../../node_modules/.pnpm/@electric-sql+pglite@0.2.9/node_modules/@electric-sql/pglite/dist/chunk-AZTFRW3V.js
Module not found: Can't resolve 'fs/promises'

https://nextjs.org/docs/messages/module-not-found

Import trace for requested module:
../../node_modules/.pnpm/@electric-sql+pglite@0.2.9/node_modules/@electric-sql/pglite/dist/index.js

I have PGlite running with Next.js 15 like a charm with 0.2.7, per https://github.com/electric-sql/pglite/issues/322#issuecomment-2372563526

villegasrfael commented 1 month ago

Same as @lirbank Even forcing the detection of 'fs/promises' returns an error

ERROR Error: Invalid FS bundle size: 21268 !== 2987856

samwillis commented 1 month ago

Hey @lirbank, @villegasrfael

Thanks for the report! I think I know whats happened, I made some changes to enable supplying the wasm bin and VFS bundle manually and it changes some of these code paths. This is top of the list for early this week.

lirbank commented 1 month ago

Nice @samwillis ! - when do you think you'll publish a new package to NPM? I'd love to try the new version.