albin
Mix ash.gen.resource failing on new project
I first create a new ash project as follows:
#!/bin/bash
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
fi
# Enable command echo
set -x
mix archive.install hex phx_new
# add deps
packages=(
"ash@github:ash-project/ash"
"ash_postgres@github:ash-project/ash_postgres"
"ash_phoenix@github:ash-project/ash_phoenix"
)
mix igniter.new $PROJECT_NAME \
--install $(IFS=,; echo "${packages[*]}") \
--with phx.new \
--extend postgres \
I then create a resource as follows:
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
fi
#PROJECT_NAME_CAPITALIZED
PCN=\
$(echo "$PROJECT_NAME" | awk '{print toupper(substr($0,1,1)) substr($0,2)}')
# Enable command echoing
set -x
cd $PROJECT_NAME
mix ash.gen.resource $PCN.Support.Ticket \
--default-actions read \
--uuid-primary-key id \
--attribute subject:string:required:public \
--extend postgres
This leads to the following error:
% mix ash.gen.resource Helpdesk.Support.Ticket \
--default-actions read \
--uuid-primary-key id \
--attribute subject:string:required:public \
--extend postgres
** (ArgumentError) expected an Elixir module, got: "Helpdesk.Support"
(elixir 1.17.1) lib/module.ex:1747: Module.split/2
(igniter 0.3.11) lib/igniter/code/module.ex:384: Igniter.Code.Module.do_proper_location/2
(ash 3.3.0) lib/mix/tasks/gen/ash.gen.domain.ex:27: Mix.Tasks.Ash.Gen.Domain.igniter/2
(ash 3.3.0) lib/mix/tasks/gen/ash.gen.resource.ex:188: Mix.Tasks.Ash.Gen.Resource.igniter/2
(ash 3.3.0) lib/mix/tasks/gen/ash.gen.resource.ex:34: Mix.Tasks.Ash.Gen.Resource.run/1
(mix 1.17.1) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.17.1) lib/mix/cli.ex:96: Mix.CLI.run_task/2
/Users/albin/.asdf/installs/elixir/1.17.1-otp-27/bin/mix:2: (file)
If I’m not wrong, this setup was working until a few commits ago. Was working before Jul 24th if memory serves right.
Most Liked
zachdaniel
Creator of Ash
zachdaniel
Creator of Ash
that is quite strange. I don’t think I’ve ever seen anything like that before
'Elixir.Mix.Tasks.Reactor.Install 2' is definitely not a module name we’d ever create.
1
ChipCoons
Strange.
In case anyone else sees this error, I ran:
mix deps.clean --all
mix deps.get
mix deps.compile
and was able to finally run mix ash.setup without the long list of errors.
1
Last Post!
zachdaniel
Creator of Ash
Popular in Questions
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
lets say i have a sample like
a = 20; b = 10;
if (a > b) do
{:ok, "a"}
end
if (a < b) do
{:ok, b}
end
if (a == b) do
{:ok, "equa...
New
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
Credo is smart enough to check for (something like) this:
assert length(the_list) == 0
with this response:
Checking if an enum is empt...
New
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
15:22:35.803 [error] gen_event {lager_file_backend...
New
Other popular topics
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
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
What is the proper way to load a module from a file in to IEX?
In the python world, doing something like this pretty standard:
from ....
New
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
15:22:35.803 [error] gen_event {lager_file_backend...
New
Latest Ash Threads
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
- #forms
- #api
- #metaprogramming
- #hex
- #security









