-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
Summary
When using NDKCacheAdapterSqliteWasm inside our Next.js app, queries that include author filters (e.g. free by:ross) intermittently crash with the following runtime error:
Wrong API use : tried to bind a value of an unknown type (undefined).
Environment
@nostr-dev-kit/ndk-cache-sqlite-wasm0.5.8@nostr-dev-kit/ndk2.14.33- Next.js 15.4.6 (React 19)
- Running in dev mode (
next dev)
Reproduction
- Configure NDK with
new NDKCacheAdapterSqliteWasm({ name: 'ants-cache', size: 64 }). - Issue a search query containing an author clause such as
free by:rossviasearchEvents(). - The sqlite worker throws the error above (originating from
setParameterinsideworker.b59ef1cc.js).
The same query works fine when switching back to the Dexie cache adapter. Looks like the WASM cache attempts to bind an undefined parameter instead of a string/number.
Could you add a guard (or coerce to empty string) before binding, or otherwise handle undefined values gracefully?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels