module AshPostgres.DataLayer.CustomIndexes is not loaded and could not be found

I'm trying Ash Postgres tutorial and I've encountered this error. Maybe it's my mistake because I already have Phoenix in my project and I'm not starting from scratch. But I've never seen this error before even when I've tried to migrate existing Elixir app. I've got this error when I've tired to create migrations and run them. So I should have all my Postgres/Ash setup ready to roll. Base Ash without Postgres worked as expected.
== Compilation error in file lib/app/support/resources/representative.ex ==
** (CompileError) lib/app/support/resources/representative.ex:4: module AshPostgres.DataLayer.CustomIndexes is not loaded and could not be found. This may be happening because the module you are trying to load directly or indirectly depends on the current module
(ash_postgres 1.3.8) expanding macro: AshPostgres.DataLayer.postgres/1
lib/app/support/resources/representative.ex:4: App.Support.Representative (module)
== Compilation error in file lib/app/support/resources/representative.ex ==
** (CompileError) lib/app/support/resources/representative.ex:4: module AshPostgres.DataLayer.CustomIndexes is not loaded and could not be found. This may be happening because the module you are trying to load directly or indirectly depends on the current module
(ash_postgres 1.3.8) expanding macro: AshPostgres.DataLayer.postgres/1
lib/app/support/resources/representative.ex:4: App.Support.Representative (module)
My other deviation from from tutorial is not calling the app Helpdesk but App. I don't think this should cause it but in case I've caused some weirdness I mention it. It's 1AM for me and I'm going to bed so I won't respond for next couple of hours.
3 Replies
frankdugan3
frankdugan33y ago
In your repo.ex file, you will want:
use AshPostgres.Repo,
otp_app: :my_app
use AshPostgres.Repo,
otp_app: :my_app
Instead of Ecto.Repo. Can you confirm you have that set up correctly?
ZachDaniel
ZachDaniel3y ago
That error looks pretty wild. I can't think of any reason that would happen except maybe spark was out of date?
lamp-town-guy
lamp-town-guyOP3y ago
Old version of ash. I've had 2.5.6 and current is 2.6. Which solved my problem. I needed to install newer version of Elixir from asdf. But now it works.

Did you find this page helpful?