lgupta
05/17/2022, 12:49 PMdefaults: {
function: {
environment,
vpc: vpc,
vpcSubnets: {
subnetType: ec2.SubnetType.PRIVATE_WITH_NAT,
},
bundle: {
externalModules: ['pg', 'better-sqlite3', 'mysql2']
}
}
},
But the above does not work when I try to deploy with seed.run
Error: There was a problem transpiling the Lambda handler: > node_modules/kysely/dist/cjs/dialect/postgres/postgres-driver.js:80:68: error: Could not resolve "pg" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
80 │ ... const pgModule = await Promise.resolve().then(() => require('pg'));
╵ ~~~~
> node_modules/kysely/dist/cjs/dialect/sqlite/sqlite-driver.js:68:72: error: Could not resolve "better-sqlite3" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
68 │ ...ule = await Promise.resolve().then(() => require('better-sqlite3'));
╵ ~~~~~~~~~~~~~~~~
> node_modules/kysely/dist/cjs/dialect/mysql/mysql-driver.js:99:71: error: Could not resolve "mysql2" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
99 │ ...mysqlModule = await Promise.resolve().then(() => require('mysql2'));
Please let me know if there is anything else that I need to add to the config. ThanksFrank