Is there a simple way to silence these? Not sure h...
# sst
d
Is there a simple way to silence these? Not sure how to effectively try/catch a downstream dep from
node_modules
Copy code
> 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);
Add as external?
p
if you add it as an
external
, 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:
Copy code
bundling: {
  logLevel: nodeLambda.LogLevel.ERROR,
}
see https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html#configuring-esbuild
f
@Jay can you take a look and see what the best way is to silence this?
d
that does seem like the ideal solution
j
Yeah we might need to add that option. Let me have a look at it.
d
cool, thank you!
p
uh, sorry, I thought sst.Function shared the same props with NodejsFunction, but sst.Function is actually not using NodejsFunction at all as I know see…
j
Yeah we needed to change the internals. But we’ll be adding more of those options.
d
🚀
f
Starting v0.10.4, only esbuild errors will be shown in the console. Run with the
--verbose
flag to show the warnings.
d
🙏 amazing