question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Claudia requires aws-sdk dependency, AWS does not

See original GitHub issue
  • Expected behaviour:

Claudia should create or update a function that uses aws-sdk without it being installed in node_modules, especially when using the --use-local-dependencies flag.

Lambda provides this dependency as part of the environment, so not installing it saves lambda disk space, and this practice is encouraged by Amazon. Clauda should not require that it is installed.

  • What actually happens:
Error: Cannot find module 'aws-sdk'
    ...
cannot require ./lambda after clean installation. Check your dependencies.
  • Steps to reproduce the problem:

Use aws-sdk as a devDependency, and try to update.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:34 (14 by maintainers)

github_iconTop GitHub Comments

5reactions
kyeoticcommented, Nov 8, 2016

I’m sure there are several solutions I as an app developer can implement to make a Lambda claudia-complaint. My point was that claudia should be able to handle any node lambda that runs in AWS. There shouldn’t be claudia-specific constraints. Its your tool and you can decide that this case is too much work for Claudia to try to tackle.

WHY USE CLAUDIA? AWS Lambda and API Gateway are incredibly flexible, but they can be tedious to set up, especially for simple scenarios. Running Node.js functions requires you to iron out quite a few quirks, that aren’t exactly well documented. Claudia automates all those steps for you.

It’s just a little surprising to read that, and then read that I need to write special code for an otherwise functional lambda to be deployed using Claudia.

2reactions
gojkocommented, Nov 8, 2016

Claudia uses its dependencies locally, and you should not include Claudia as a production dependency, only as a development one. Claudi Bot builder does not use aws-sdk, so it does not need it.

If your code requires aws-sdk, and you do not want to deploy it, use it as an optional dependency (npm install aws-sdk -O) and then deploy using --no-optional-dependencies, this will exclude AWS SDK from the final package.

--use-local-dependencies just copies whatever you have locally. It’s your job then to make sure development dependencies are not installed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

claudiajs/claudia - Gitter
Hi, I upgraded npm and claudia in a codebase that has worked fine, and now I get a problem where during claudia package...
Read more >
Lambda function does not automatically set aws-sdk ...
The first option doesn't work because it omits all dependencies, even those not in the default Lambda runtime environment.
Read more >
Using claudia.js to send emails using AWS Lambda
TLDR; This post explains how to use claudia.js to send emails via AWS Lambda using AWS Simple Email Service. In a previous post...
Read more >
The AWS SDK for Java 2.17 removes its external dependency ...
x no longer requires an external copy of Jackson-databind, Jackson-core, or Jackson-dataformat-cbor in order to function. This release does not ...
Read more >
Installing and configuring Claudia.js
How to set up Claudia.js and configure credentials for deploying AWS Lambda ... so it does not introduce any runtime dependencies — so...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found