Missing :adapter option

Hi guys! My problem is getting such error while compilation:

== Compilation error in file lib/angotia_catalogs_api/repo.ex ==
** (ArgumentError) missing :adapter option on use Ecto.Repo
    lib/ecto/repo/supervisor.ex:66: Ecto.Repo.Supervisor.compile_config/2
    lib/angotia_catalogs_api/repo.ex:2: (module)
    (stdlib 3.13) erl_eval.erl:680: :erl_eval.do_apply/6
    (elixir 1.10.3) lib/kernel/parallel_compiler.ex:304: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

But my repo.ex file consists :adapter. I got this error after upgrading all my dependencies in mix.exs.
Here is my project repo: https://github.com/RafalKostecki/angotia-catalogs/tree/dev (dev branch)

Try refetching and recompiling all dependencies:

# In your project's root directory
rm -rf _build/ deps/ && mix do deps.get, compile

Still get the same error

Then show us the output of this in iex:

Application.fetch_env!(:yourapp, YourApp.Repo)

Replace :yourapp with your OTP app name (specified in mix.exs) and YourApp.Repo with your Ecto repository module, usually defined in lib/yourapp/repo.ex.

In Ecto 3, you need to put the :adapter here: https://github.com/RafalKostecki/angotia-catalogs/blob/dev/lib/angotia_catalogs_api/repo.ex#L2

2 Likes

Thanks! I added adapter to Repo

use Ecto.Repo,
    otp_app: :angotia_catalogs_api,
    adapter: Ecto.Adapters.Postgres

Also I deleted

use Absinthe.Ecto, repo: AngotiaCatalogsApi.Repo

from my types files and I got another error:

/home/kostek/Documents/Programming/angotia-catalogs/lib/angotia_catalogs_api_web/schemas/npc_types.ex:34

:dialog is not a valid type for field :dialogs because
:dialog is an ObjectTypeDefinition, and this field is part of an InputObjectTypeDefinition.

I was reading bout that, and It should be associated with absinthe 1.4.x version, but I have 1.5.1. What’s wrong?