(UndefinedFunctionError) function always

I am new to elixir and phoenix . I am getting this error in all routes . This is a example of hello app with a post route . What am i doing wrong??
nothing works not creating a new mvc like posts or even adding an app like exadmin , all gives this error.

Error:

[error] #PID<0.367.0> running HelloWeb.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /posts
** (exit) an exception was raised:
** (UndefinedFunctionError) function HelloWeb.PostController.init/1 is undefined (module HelloWeb.PostController is not available)

when i do mix phx.routes i get the below , but i always get this error when i create any mvc or even use exadmin . What am i doing wrong??

page_path GET / HelloWeb.PageController :index
post_path GET /posts HelloWeb.PostController :index
post_path GET /posts/:id/edit HelloWeb.PostController :edit
post_path GET /posts/new HelloWeb.PostController :new
post_path GET /posts/:id HelloWeb.PostController :show
post_path POST /posts HelloWeb.PostController :create
post_path PATCH /posts/:id HelloWeb.PostController :update
PUT /posts/:id HelloWeb.PostController :update
post_path DELETE /posts/:id HelloWeb.PostController :delete

It says there’s no module called HelloWeb.PostController. Did you type the module name correctly in the defmodule? Is it placed somewhere the compiler can see? (elixirc_paths in mix.exs)

Would you mind linking what tutorial or documentation you are following? Also, I would recommend you post this in a Phoenix-related section instead next time!


Woops: Actually yes, your module seems not to be available for Plug to call - my bad on that!

From the stack trace, your HelloWeb.PostController module is missing an init/1 function. This exception is raised by Plug here because you seem to have plug HelloWeb.PostController somewhere in your code. Are you able to locate this plug line?