Help needed to resolve the error on live view : building twitter clone video

I am following the video on about building a twitter clone and i am getting this error. I have followed it exactly

function is undefined (module PostLive.Index is not available)

can someone guide so i can move ahead in the tutorial. cannot figure what i am doing wrong.

1 Like

I didn’t watch the video yet (I intend to watch it soon) so I don’t know much about the application you’re building, but the error says that the PostLive.Index module is not defined. Did you define it somewhere in your code (either manually or with a generator)? If you did define such a module, check for wrong spelling or case.

Also, posting here the stacktrace would help figuring out where the error comes from.

I just watched the video. Again, context on your error would be useful, but one way this error could occur is if you copy/pasted the live routes in the wrong place.

You need to paste them inside this block in router.ex:

scope "/", ChirpWeb do
  pipe_through :browser

  # paste the live routes here

If you pasted them somewhere else the module won’t be found (because it is defined within ChirpWeb).

I might be completely off, more info would help narrowing down the issue, but this is one possibility.


@lucaong this resolved

1 Like