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
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.
Last Post!
klo
yep! the solution was to remove the optional: true and all was fine. The warning was gone from the parent app.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









