Hi all, I am using <kysely> and <kysely-data-api> ...
# help
l
Hi all, I am using kysely and kysely-data-api with postgres but I am getting the following error when trying to create a record in the table. Can someone please help me understand this error message. Thanks
f
Hey @lgupta, can you try including these 3 packages in the Function’s
bundle.externalModules
? Here’s an example https://docs.serverless-stack.com/constructs/Function#externalmodules
That said, I’m curious why all drivers are being loaded. @thdxr do u have any idea?
j
@lgupta did you install
pg
(or any of the drivers) manually? As I did that initially and came up with similar errors. Just remove it from
package.json
and run
npm/yarn install
again and see if that fixes it
t
Also are you doing a star import?
l
Hi @justindra and @thdxr, thanks for the reply. I have not install
pg
and not using the star import. Is there any other suggestions?
t
can I see how you're initializing kysely?
l
Copy code
import { Kysely } from 'kysely'
import { DataApiDialect } from '../../../../node_modules/kysely-data-api'
Copy code
import { DataApiDialect } from 'kysely-data-api'
seems to not work for data-api
t
l
Thanks @thdxr. Let me give it a try.
Thanks everyone. @Frank’s suggestion worked for me 🙂