-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
phx.gen.live doesn't work in umbrella app #4566
Comments
Also, more or less the same thing happens with |
@cjbottaro I couldn't replicate your scenario, please see the details: $ mix archive.uninstall phx_new
Are you sure you want to uninstall /Users/milmazz/.asdf/installs/elixir/1.12.2-otp-24/.mix/archives/phx_new-1.6.0? [Yn] Y
$ mix archive.install hex phx_new
Resolving Hex dependencies...
Dependency resolution completed:
New:
phx_new 1.6.2
* Getting phx_new (Hex package)
All dependencies are up to date
Compiling 11 files (.ex)
Generated phx_new app
Generated archive "phx_new-1.6.2.ez" with MIX_ENV=prod
Are you sure you want to install "phx_new-1.6.2.ez"? [Yn] Y
* creating /Users/milmazz/.asdf/installs/elixir/1.12.2-otp-24/.mix/archives/phx_new-1.6.2 Create Umbrella Project
$ mix phx.new web --umbrella
* creating web_umbrella/.gitignore
* creating web_umbrella/config/config.exs
* creating web_umbrella/config/dev.exs
* creating web_umbrella/config/test.exs
* creating web_umbrella/config/prod.exs
* creating web_umbrella/config/runtime.exs
* creating web_umbrella/mix.exs
* creating web_umbrella/README.md
* creating web_umbrella/.formatter.exs
* creating web_umbrella/apps/web_web/lib/web_web.ex
* creating web_umbrella/apps/web_web/lib/web_web/application.ex
* creating web_umbrella/apps/web_web/lib/web_web/endpoint.ex
* creating web_umbrella/apps/web_web/lib/web_web/router.ex
* creating web_umbrella/apps/web_web/lib/web_web/telemetry.ex
* creating web_umbrella/apps/web_web/lib/web_web/views/error_helpers.ex
* creating web_umbrella/apps/web_web/lib/web_web/views/error_view.ex
* creating web_umbrella/apps/web_web/mix.exs
* creating web_umbrella/apps/web_web/README.md
* creating web_umbrella/apps/web_web/.gitignore
* creating web_umbrella/apps/web_web/test/test_helper.exs
* creating web_umbrella/apps/web_web/test/support/channel_case.ex
* creating web_umbrella/apps/web_web/test/support/conn_case.ex
* creating web_umbrella/apps/web_web/test/web_web/views/error_view_test.exs
* creating web_umbrella/apps/web_web/.formatter.exs
* creating web_umbrella/apps/web_web/lib/web_web/controllers/page_controller.ex
* creating web_umbrella/apps/web_web/lib/web_web/views/layout_view.ex
* creating web_umbrella/apps/web_web/lib/web_web/views/page_view.ex
* creating web_umbrella/apps/web_web/test/web_web/controllers/page_controller_test.exs
* creating web_umbrella/apps/web_web/test/web_web/views/page_view_test.exs
* creating web_umbrella/apps/web_web/assets/vendor/topbar.js
* creating web_umbrella/apps/web_web/lib/web_web/templates/layout/root.html.heex
* creating web_umbrella/apps/web_web/lib/web_web/templates/layout/app.html.heex
* creating web_umbrella/apps/web_web/lib/web_web/templates/layout/live.html.heex
* creating web_umbrella/apps/web_web/lib/web_web/templates/page/index.html.heex
* creating web_umbrella/apps/web_web/test/web_web/views/layout_view_test.exs
* creating web_umbrella/apps/web_web/lib/web_web/gettext.ex
* creating web_umbrella/apps/web_web/priv/gettext/en/LC_MESSAGES/errors.po
* creating web_umbrella/apps/web_web/priv/gettext/errors.pot
* creating web_umbrella/apps/web_web/assets/css/phoenix.css
* creating web_umbrella/apps/web_web/assets/css/app.css
* creating web_umbrella/apps/web_web/assets/js/app.js
* creating web_umbrella/apps/web_web/priv/static/robots.txt
* creating web_umbrella/apps/web_web/priv/static/images/phoenix.png
* creating web_umbrella/apps/web_web/priv/static/favicon.ico
* creating web_umbrella/apps/web/lib/web/application.ex
* creating web_umbrella/apps/web/lib/web.ex
* creating web_umbrella/apps/web/test/test_helper.exs
* creating web_umbrella/apps/web/README.md
* creating web_umbrella/apps/web/mix.exs
* creating web_umbrella/apps/web/.gitignore
* creating web_umbrella/apps/web/.formatter.exs
* creating web_umbrella/apps/web/lib/web/repo.ex
* creating web_umbrella/apps/web/priv/repo/migrations/.formatter.exs
* creating web_umbrella/apps/web/priv/repo/seeds.exs
* creating web_umbrella/apps/web/test/support/data_case.ex
* creating web_umbrella/apps/web/lib/web/mailer.ex
Fetch and install dependencies? [Yn] Y
* running mix deps.get
* running mix deps.compile
We are almost there! The following steps are missing:
$ cd web_umbrella
Then configure your database in config/dev.exs and run:
$ mix ecto.create
Start your Phoenix app with:
$ mix phx.server
You can also run your app inside IEx (Interactive Elixir) as:
$ iex -S mix phx.server $ cd web_umbrella/apps/web_web/
$ mix phx.gen.live --no-context --no-schema --context-app web Foo Signup users
==> web
Compiling 4 files (.ex)
Generated web app
==> web_web
* creating lib/web_web/live/signup_live/show.ex
* creating lib/web_web/live/signup_live/index.ex
* creating lib/web_web/live/signup_live/form_component.ex
* creating lib/web_web/live/signup_live/form_component.html.heex
* creating lib/web_web/live/signup_live/index.html.heex
* creating lib/web_web/live/signup_live/show.html.heex
* creating test/web_web/live/signup_live_test.exs
* creating lib/web_web/live/modal_component.ex
* creating lib/web_web/live/live_helpers.ex
* injecting lib/web_web.ex
Add the live routes to your browser scope in lib/web_web/router.ex:
live "/users", SignupLive.Index, :index
live "/users/new", SignupLive.Index, :new
live "/users/:id/edit", SignupLive.Index, :edit
live "/users/:id", SignupLive.Show, :show
live "/users/:id/show/edit", SignupLive.Show, :edit |
I also could not reproduce this. Please reopen if it persists in more recent Phoenix versions. :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It finally generates some things, but crashes before it finishes. Further, it seems to completely ignore
--no-context
and--no-schema
.I'm using Phoenix 1.6.2.
Thanks for the help.
The text was updated successfully, but these errors were encountered: