hello all, n00b Q: Using nextjs-on-pages + cf-binding-proxy + d1 + lucia: e: TypeError: (intermedi

hello all, n00b Q:
Using nextjs-on-pages + cf-binding-proxy + d1 + lucia:


e: TypeError: (intermediate value) is not iterable
at Object.getSessionAndUser (webpack-internal:///(rsc)/./node_modules/.pnpm/@lucia-auth+adapter-sqlite@2.0.0_better-sqlite3@8.5.2_lucia@2.4.0/node_modules/@lucia-auth/adapter-sqlite/dist/drivers/d1.js:145:89)


the offending code:
const [{ results: sessionResults},{ results: userFromJoinResults }] 

= (await db.batch([                     getSessionStatement,          getUserFromJoinStatement
]));


i adjusted syntax:
                        const batchRes = (await db.batch([
                            getSessionStatement,
                            getUserFromJoinStatement
                        ]));
                        const sessionResults = batchRes[0].results
                        const userFromJoinResults = batchRes[1].results

now it passes, but i don't understand why, i was originally on node 16, but upgraded to 18 and still same error, if anyone has any thoughts super open to feedback, my first thought is something is wrong with versioning of JS or something since its just a syntax issue, but also not sure if its something i misconfigured for d1
Was this page helpful?