A phoenix version incompatibility issue
Versions
- elixir 1.14.3
- erlang 24.2.1
Create First Resource
$ mix phx.gen.html Inventory Item items name:string description:text purchase_date:date value:decimal
* creating lib/app_web/controllers/item_controller.ex
* creating lib/app_web/controllers/item_html/edit.html.heex
* creating lib/app_web/controllers/item_html/index.html.heex
* creating lib/app_web/controllers/item_html/new.html.heex
* creating lib/app_web/controllers/item_html/show.html.heex
* creating lib/app_web/controllers/item_html/item_form.html.heex
* creating lib/app_web/controllers/item_html.ex
* creating test/app_web/controllers/item_controller_test.exs
* creating lib/app/inventory/item.ex
* creating priv/repo/migrations/20230510090650_create_items.exs
* creating lib/app/inventory.ex
* injecting lib/app/inventory.ex
* creating test/app/inventory_test.exs
* injecting test/app/inventory_test.exs
* creating test/support/fixtures/inventory_fixtures.ex
* injecting test/support/fixtures/inventory_fixtures.ex
Desc
The tutorial to create first resource items then
browser http://localhost:4000/items
will show Internal Server Error
the console below:
17:44:34.434 [error] #PID<0.1480.0> running Phoenix.Endpoint.SyncCodeReloadPlug (connection #PID<0.1477.0>, stream id 2) terminated
Server: localhost:4000 (http)
Request: HEAD /items
** (exit) an exception was raised:
** (ArgumentError) no "index" html template defined for AppWeb.ItemView
(phoenix_template 1.0.1) lib/phoenix/template.ex:241: Phoenix.Template.render_with_fallback/4
(phoenix_template 1.0.1) lib/phoenix/template.ex:197: Phoenix.Template.render_within_layout/4
(phoenix 1.7.1) lib/phoenix/controller.ex:997: anonymous fn/5 in Phoenix.Controller.template_render/4
(telemetry 1.2.1) /Users/cam/proj/elixir/legendary/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
(phoenix 1.7.1) lib/phoenix/controller.ex:984: Phoenix.Controller.render_with_layouts/4
(phoenix 1.7.1) lib/phoenix/controller.ex:971: Phoenix.Controller.render_and_send/4
(app 0.1.0) lib/app_web/controllers/item_controller.ex:1: AppWeb.ItemController.action/2
(app 0.1.0) lib/app_web/controllers/item_controller.ex:1: AppWeb.ItemController.phoenix_controller_pipeline/2
How to fix the bug? thx
Edited by yang cancai