@middy/http-multipart-body-parser is an optional peer dependency, so it is
imported lazily on the first request that has a body: consumers who never
enable this step need not install it. The parsed body is passed through
unchanged (no reshaping); limits are left to the parser's own defaults and
any busboy.limits the caller supplies.
The .catch is load-bearing: bundlers such as esbuild (used by the
Serverless Framework) fail the build on an unresolvable bare import(),
but leave it as a runtime import when the promise is handled. It also turns
a missing package into an actionable error instead of a bare
ERR_MODULE_NOT_FOUND.
Opt-in
multipart/form-databody parser step.@middy/http-multipart-body-parseris an optional peer dependency, so it is imported lazily on the first request that has a body: consumers who never enable this step need not install it. The parsed body is passed through unchanged (no reshaping); limits are left to the parser's own defaults and anybusboy.limitsthe caller supplies.The
.catchis load-bearing: bundlers such as esbuild (used by the Serverless Framework) fail the build on an unresolvable bareimport(), but leave it as a runtime import when the promise is handled. It also turns a missing package into an actionable error instead of a bareERR_MODULE_NOT_FOUND.