Skip to content

PGLite crashes on macOS 26.x (Tahoe) due to WASM runtime bug #1670

@roysaurav

Description

@roysaurav

Bug Report

Summary

gbrain init --pglite crashes on macOS 26.x (Tahoe) on Apple Silicon (arm64) due to a WASM runtime bug in the embedded PGLite engine. The crash occurs at engine initialization time, before any user data is processed.

Environment

  • macOS: 26.5 (Build 25F71) — Apple Silicon (arm64)
  • Bun: 1.3.14
  • gbrain: 0.41.29.0
  • Chip: Apple M-series (arm64)

Steps to Reproduce

  1. Install gbrain on macOS 26.x (Tahoe) with Apple Silicon
  2. Run gbrain init --pglite
  3. Observe WASM crash during PGLite engine initialization

Expected Behavior

PGLite should initialize successfully and create the local database.

Actual Behavior

The process crashes with a WASM-related error during PGLite engine startup. The crash is in the WASM runtime layer, not in gbrain code itself. This appears to be a known issue with WASM execution on macOS 26.x.

Workaround: Use Native PostgreSQL

A complete workaround is to bypass PGLite and use a native Homebrew PostgreSQL installation instead. Full step-by-step setup:

# Install PostgreSQL + pgvector
brew install postgresql@17
brew services start postgresql@17
createdb gbrain

# Build pgvector from source
cd /tmp && git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git
cd pgvector && make && make install
psql gbrain -c "CREATE EXTENSION IF NOT EXISTS vector;"

# Configure gbrain to use native Postgres
cat > ~/.gbrain/config.json << 'EOF'
{
  "engine": "postgres",
  "database_url": "postgresql://localhost:5432/gbrain",
  "schema_pack": "gbrain-base-v2"
}
EOF

# Initialize and verify
gbrain apply-migrations --yes
gbrain doctor

All 102 migrations pass. gbrain doctor reports clean status. Full brain functionality verified: put, search, link, files upload-raw, etc.

Impact

This affects all macOS 26.x (Tahoe) users on Apple Silicon using the default --pglite install path. The README recommends PGLite as the primary method ("2 seconds; no server"), so new users on the latest macOS hit this immediately.

Suggested Fix

  1. Short-term: Add docs about the macOS 26.x WASM incompatibility and the native Postgres workaround (PR incoming)
  2. Medium-term: Have gbrain init detect macOS 26.x + arm64 and auto-suggest the Postgres engine path
  3. Long-term: Track the upstream WASM fix (likely in Bun or the underlying WASM engine)

Reporter

Saurav Roy — gbrain v0.41.29.0 user, verified on macOS 26.5 arm64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions