D1 driver, the client passed to SQLiteD1Session is undefined, causing client.prepare to throw.
When using the D1 driver, the client passed to SQLiteD1Session is undefined, causing client.prepare to throw. Can we add a null check or ensure the driver is correctly passed?
I am using default setup as in readme.md and got error on first pnpm dev
in worker-configuration.d.ts:
declare namespace Cloudflare { interface Env { DISABLED_CACHE: true; DB: D1Database; } }
update to
declare namespace Cloudflare { interface Env { DISABLED_CACHE: true; D1: D1Database; } }
in wrangler.toml,
change binding = "DB" to binding = "D1"
it works for me
Closing this issue as it's no longer relevant following the SonicJS 2.0 rewrite. The 2.0 version is a complete architectural overhaul with significant improvements to the core framework. If you encounter similar issues with 2.0, please open a new issue with updated details. Thank you!