ash-project / ash_postgres

The PostgreSQL data layer for Ash Framework
https://hexdocs.pm/ash_postgres
MIT License
140 stars 73 forks source link

function Inflex.pluralize/1 is undefined (module Inflex is not available) #399

Closed mxgrn closed 1 month ago

mxgrn commented 1 month ago

Describe the bug

I'm following the Getting started section on ash_postgres. When trying to run mix ash.patch.extend, I'm getting the above error.

Here's the full output:

➡ mix ash.patch.extend Botpresto.Ash.Users.User postgres
** (UndefinedFunctionError) function Inflex.pluralize/1 is undefined (module Inflex is not available)
    Inflex.pluralize("user")
    (ash_postgres 2.2.0) lib/data_layer.ex:2977: AshPostgres.DataLayer.install/5
    (ash 3.4.26) lib/mix/tasks/patch/ash.patch.extend.ex:163: anonymous fn/6 in Mix.Tasks.Ash.Patch.Extend.patcher/5
    (elixir 1.17.2) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ash 3.4.26) lib/mix/tasks/patch/ash.patch.extend.ex:32: Mix.Tasks.Ash.Patch.Extend.run/1
    (mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.17.2) lib/mix/cli.ex:96: Mix.CLI.run_task/2
    /Users/mxgrn/.asdf/installs/elixir/1.17.2-otp-27/bin/mix:2: (file)
zachdaniel commented 1 month ago

🤔 is AshPostgres on the latest version? Does it work if you do mix compile first?

zachdaniel commented 1 month ago

Can you try ash main and see if that works?

mxgrn commented 1 month ago

mix compile runs fine, the exact versions can be seen in my output, I suppose. I'll try main now.

zachdaniel commented 1 month ago

I'd try upgrading to the latest versions of the relevant packages and trying again also.

mix deps.update ash ash_postgres igniter

Your ash_postgres is a few versions behind.

mxgrn commented 1 month ago

Your ash_postgres is a few versions behind.

Hm, I wonder how I ended up with older versions when starting afresh... After updating, it worked, thanks!

mxgrn commented 1 month ago

I wonder how I ended up with older versions when starting afresh

I figured it out. My mix.lock did have an older version of Ecto, which made ash_postgres to resolve to its older version, too.

Something to keep in mind for the future. Sorry that it didn't occur to me the first time you suggested to check the ash_postgres version, I was too confident that I had the latest 🤦‍♂️