I am looking for an SST example that uses commonjs...
# help
h
I am looking for an SST example that uses commonjs style function. I need this because seems puppeteer doesn't work well with the esmodule. New to javascript so hope this is possible. Thanks!
Found this example: https://github.com/serverless-stack/examples/blob/main/layer-chrome-aws-lambda/lib/MyStack.js While it doesn't answer my question, it solved my problem đŸ™‚
f
Hey @Hongqi Wang, glad u got it working.
Just wanted to mention that Function has a
format
field that takes
cjs
or
esm
. Mayvbe that’s what u were looking for https://docs.serverless-stack.com/constructs/Function#format
k
@Frank I'm curious if the reported issue could perhaps be related to the ESM layer issue still being present. Are SST-Functions with
layers:...
present implicitly enforcing a
cjs
function format for now?