Dmitry Pavluk
03/19/2021, 3:18 AMnode_modules
> node_modules/formidable/lib/file.js:1:19: warning: Indirect calls to "require" will not be bundled (surround with a try/catch to silence this warning)
1 │ if (global.GENTLY) require = GENTLY.hijack(require);
Dmitry Pavluk
03/19/2021, 3:19 AMp0wl
03/19/2021, 7:56 AMexternal
, the module (formidable) will not be bundled with your code and you have to make sure it is available in the lambda (e.g. from a layer or a post build action).
If you don’t want to bundle it, but want to install it via npm, you should put it to node_modules
(see https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html#install-modules).
If you just want to get rid of the warning, overwrite bundling.logLevel like this:
bundling: {
logLevel: nodeLambda.LogLevel.ERROR,
}
see https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html#configuring-esbuildFrank
Dmitry Pavluk
03/19/2021, 3:45 PMFunctionBundleProps
:
https://github.com/serverless-stack/serverless-stack/blob/master/packages/resources/src/Function.ts#L80Dmitry Pavluk
03/19/2021, 3:46 PMJay
Dmitry Pavluk
03/19/2021, 3:46 PMp0wl
03/19/2021, 3:49 PMJay
Dmitry Pavluk
03/19/2021, 4:02 PMFrank
Frank
--verbose
flag to show the warnings.Dmitry Pavluk
03/25/2021, 4:52 AM