Erik Robertson
10/26/2021, 7:02 PMBuilding Lambda _function_ src/list.main
> node_modules/sequelize/lib/dialects/postgres/hstore.js:3:23: error: Could not resolve "pg-hstore" (_mark_ it _as_
external
to
_exclude_ it _from_
the
_bundle_, _or_
_surround_ it _with_
_try_/_catch_
to
handle
the
failure
at
_run_-_time_)
3 │ const hstore = require('pg-hstore')({ sanitize: _true_ });
And I've tried putting the module as external_modules as recommended (and also tried node_modules) but with no success in my stack API definition:
defaultFunctionProps: {
bundle: {
node_modules: ['pg-hstore'],
// external_modules: ['pg-hstore'],
// node_modules: ['pg', 'sqlite3', 'tedious', 'pg-hstore']
}
},
Any idea ?
thdxr
10/26/2021, 7:15 PMnodeModules
thdxr
10/26/2021, 7:15 PMErik Robertson
10/26/2021, 8:26 PMCannot extract version for module 'pg'. Check that it's referenced in your package.json or installed.
Any other idea ? I'm indeed not referencing that package since I'm not using it...thdxr
10/26/2021, 8:30 PMthdxr
10/26/2021, 8:30 PMErik Robertson
10/26/2021, 9:07 PMErik Robertson
10/26/2021, 9:12 PMthdxr
10/26/2021, 9:14 PMthdxr
10/26/2021, 9:14 PMErik Robertson
10/26/2021, 9:20 PMErik Robertson
10/26/2021, 9:20 PMErik Robertson
10/26/2021, 9:24 PM"Please install mysql2 package manually"
Does this imply that mysql2 needs to be installed as a Lambda layer ?? I'd be surprised since no one else mentioned this...Erik Robertson
10/26/2021, 9:44 PMdefaultFunctionProps: {
bundle: {
externalModules: ['pg-hstore'],
nodeModules: ['mysql2']
}
},
thdxr
10/26/2021, 10:18 PMthdxr
10/26/2021, 10:18 PMthdxr
10/26/2021, 10:19 PMErik Robertson
10/27/2021, 9:40 AM