https://serverless-stack.com/ logo
#sst
Title
# sst
d

Dmitry Pavluk

03/19/2021, 3:18 AM
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

p0wl

03/19/2021, 7:56 AM
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

Frank

03/19/2021, 8:01 AM
@Jay can you take a look and see what the best way is to silence this?
d

Dmitry Pavluk

03/19/2021, 3:45 PM
that does seem like the ideal solution
j

Jay

03/19/2021, 3:46 PM
Yeah we might need to add that option. Let me have a look at it.
d

Dmitry Pavluk

03/19/2021, 3:46 PM
cool, thank you!
p

p0wl

03/19/2021, 3:49 PM
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

Jay

03/19/2021, 4:01 PM
Yeah we needed to change the internals. But we’ll be adding more of those options.
d

Dmitry Pavluk

03/19/2021, 4:02 PM
🚀
f

Frank

03/19/2021, 11:29 PM
Starting v0.10.4, only esbuild errors will be shown in the console. Run with the
--verbose
flag to show the warnings.
d

Dmitry Pavluk

03/25/2021, 4:52 AM
🙏 amazing