/turbopack-test

Test sqlite and pglite compatibility with nextjs with and without turbopack

Primary LanguageTypeScript

This is a repo to test SQLite and PGLite support within NextJS. Mainly to establish support for ElectricSQL projects

tested with:

Bun 1.1.8

  "dependencies": {
    "@electric-sql/pglite": "^0.1.5",
    "electric-sql": "^0.11.1",
    "next": "^14.2.0",
    "wa-sqlite": "rhashimoto/wa-sqlite#v0.9.13"
  },
Webpack Turbopack
SQLite
PGLite

Setup

Install:

bun i

With NextJS webpack

Start:

bun run dev

With NextJS Turbopack

Start:

bun run dev -- --turbo

Test in browser

Using webpack, SQLite loads in the browser, though we don't have a server in order to make reproduction easier. SQLite succeeding in NextJS webpack

With Turbopack it is not bundling properly. SQLite failing in NextJS Turbopack

Using webpack, PGLIte is not bunding properly. PGLIte failing in NextJS webpack

Using Turbopack, PGLIte is not bunding properly. PGLIte failing in NextJS Turbopack