klo

klo

Ex_aws lambda invoke is undefined

i have an app app1 which uses ExAws.Lambda.invoke/4. All is well and no compile warnings.

Another app say app2 uses app1 as a dependency. For some reason I get a compile warning: ExAws.Lambda.invoke/4 is undefined (module ExAws.Lambda is not available or is yet to be defined) lib/app2/client.ex:40: App2.Client.get_page/2.

Now in App1, i have aliased
alias ExAws.Lambda and calling the function as such:

 function_name
    |> Lambda.invoke(
      config,
      %{},
      invocation_type: :request_response
    )
    |> ex_aws.request()

The warning comes from app2 on a fresh compile but not on subsequent compiles even when forced using the --force option. I also have to remove _build and deps for the warning to show.

Marked As Solved

fireproofsocks

fireproofsocks

The cause can be if the “child” app has any options in its mix.exs that qualify the dependency, e.g.

{:ex_aws_lambda, "~> 2.0.2", optional: true}

might need to be just:

{:ex_aws_lambda, "~> 2.0.2"}

The optional parameter is one of those weird gotchas that in effect makes the child app say “hey parent – your call on what to do here.” In effect, it requires the parent app to be aware of what the child app is doing EVEN IF the parent isn’t directly calling that dependency.

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement