Swapnil Bandiwadekar
05/27/2022, 2:18 PMsst
today to 1.2.9
Could not resolve "mock-aws-s3"
node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:43:28:
43 │ const AWSMock = require('mock-aws-s3');
╵ ~~~~~~~~~~~~~
You can mark the path "mock-aws-s3" as external to exclude it from the bundle, which will remove
this error. You can also surround this "require" call with a try/catch block to handle this
failure at run-time instead of bundle-time.
✘ [ERROR] Could not resolve "pg-native"
node_modules/pg/lib/native/client.js:4:21:
4 │ var Native = require('pg-native')
╵ ~~~~~~~~~~~
You can mark the path "pg-native" as external to exclude it from the bundle, which will remove
this error. You can also surround this "require" call with a try/catch block to handle this
failure at run-time instead of bundle-time.
✘ [ERROR] Could not resolve "nock"
node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:112:23:
112 │ const nock = require('nock');
╵ ~~~~~~
You can mark the path "nock" as external to exclude it from the bundle, which will remove this
error. You can also surround this "require" call with a try/catch block to handle this failure at
run-time instead of bundle-time.
thdxr
05/27/2022, 2:18 PMSwapnil Bandiwadekar
05/27/2022, 2:21 PMthdxr
05/27/2022, 2:23 PMSwapnil Bandiwadekar
05/27/2022, 2:23 PMthdxr
05/27/2022, 2:24 PMthdxr
05/27/2022, 2:24 PMSwapnil Bandiwadekar
05/27/2022, 2:25 PMthdxr
05/27/2022, 2:26 PMthdxr
05/27/2022, 2:26 PMKlaus
05/27/2022, 2:27 PMSwapnil Bandiwadekar
05/27/2022, 2:28 PMKlaus
05/27/2022, 2:29 PMesbuild:
bundle: true
packager: npm
exclude: ['pg-native'] // <<--
Swapnil Bandiwadekar
05/27/2022, 2:31 PMthdxr
05/27/2022, 2:31 PMKlaus
05/27/2022, 2:31 PMnew Function(stack, "MyLambda", {
bundle: {
externalModules: ["pg-native"],
try that aboveKlaus
05/27/2022, 2:32 PMSwapnil Bandiwadekar
05/27/2022, 2:32 PMpackage.json
in that lamda directory.Swapnil Bandiwadekar
05/27/2022, 2:34 PMKlaus
05/27/2022, 2:36 PMKlaus
05/27/2022, 2:44 PMpg
? Seeing your package.json + the way you define the data base related function might be usefulSwapnil Bandiwadekar
05/27/2022, 2:46 PMKlaus
05/27/2022, 2:49 PM