Problem with running the new Phoenix 1.3 umbrella generators

Before creating an issue on the Phoenix repository about this, I want to make sure that I am not missing something myself :sweat_smile:!

I wanted to create a new application that uses Phoenix 1.3

So I updated Phoenix by re-running

mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Then created an umbrella application using

mix new appname --umbrella

Then went to the /apps directory of the new application

cd appname/apps

And finally tried running the new phoenix umbrella generator

mix phx.new.web

But now I got the following response:

** (FunctionClauseError) no function clause matching in Mix.Tasks.Phx.New.Web.run/1
    lib/mix/tasks/phx.new.web.ex:29: Mix.Tasks.Phx.New.Web.run([])
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
    (elixir) lib/code.ex:370: Code.require_file/2

I also tried mix phx.new.ecto:

** (FunctionClauseError) no function clause matching in Mix.Tasks.Phx.New.Ecto.run/1
    lib/mix/tasks/phx.new.ecto.ex:45: Mix.Tasks.Phx.New.Ecto.run([])
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
    (elixir) lib/code.ex:370: Code.require_file/2

What is going wrong?

1 Like

the usage is mix phx.new.web appname, see: mix help phx.new.web. Same goes for phx.new.ecto. But yeah, it’s a bug in the task, it should gracefully handle this error; perhaps indeed open up an issue on phoenix?

5 Likes

Awesome! That indeed was it.

I have opened an issue about the error messages not being clear.

Thank you, @wojtekmach!

2 Likes

Hello, try mix phx.new appname --umbrella it’ll generate your umbrella application in which you’ll see under the apps folder the appname directory & the appname_web directory.

2 Likes

So will this use phx.gen.web and phx.gen.ecto at the same time?

1 Like

try and may be you’ll be able to achieve what you want!

1 Like
1 Like