Hi,
I tried to extend the prisma client using this eoin-obrien/prisma-extension-kysely: Drop down to raw SQL in Prisma without sacrificing type safety! (github.com). But got an error because of the logger.
api | TypeError: config.db.$on is not a function
api | at /Users/downey/Documents/Dev.nosync/budget/node_modules/@redwoodjs/api/dist/logger/index.js:268:17
api | at Array.forEach (<anonymous>)
api | at handlePrismaLogging (/Users/downey/Documents/Dev.nosync/budget/node_modules/@redwoodjs/api/dist/logger/index.js:253:21)
api | at Object.<anonymous> (/Users/downey/Documents/Dev.nosync/budget/api/src/lib/db.ts:38:1)
api | at Module._compile (node:internal/modules/cjs/loader:1241:14)
api | at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
api | at Module.load (node:internal/modules/cjs/loader:1091:32)
api | at Module._load (node:internal/modules/cjs/loader:938:12)
api | at Module.require (node:internal/modules/cjs/loader:1115:19)
api | at require (node:internal/modules/helpers:130:18)
After searching around I found this github issue $on
argument type error when extending prisma client · Issue #11986 · prisma/prisma (github.com)
Currently I just remove the logging in the api/src/lib/db.ts
to avoid the problem.
handlePrismaLogging({
db,
logger,
logLevels: ['info', 'warn', 'error'],
})