Hey :slightly_smiling_face: We’re struggling with ...
# help
l
Hey 🙂 We’re struggling with external modules in local development. We’re seeing “Could not resolve “class-transformer” (mark it as external to exclude it from the bundle)” errors on the “Starting lambda code…” step. We’ve listed those externals in the bundle prop of the functions already. Any ideas/tips?
a
I was seeing this error in image 1, and changed the setting, now it works, but you mentioned you added to the external already
r
try setting it in the nodeModules property instead
l
Hmm yeah tried nodeModules & externalModules already. Will look into in more detail then :) Thanks 🙏🏼
f
Hey @Luca Demmel, can you share a basic repo using “class-transformer”? It’s pretty quick to put together a basic repo, something like: 1.
npx create-serverless-stack@latest my-sst-app
2.
npm install class-transformer
3. import
class-transformer
and use it in the lambda code (in
src/
) 4. run
npx sst build
should give the error