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

I am following the video on https://www.phoenixframework.org about building a twitter clone and i am getting this error. I have followed it exactly

function PostLive.Index.live/0 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
end

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.

6 Likes

@lucaong this resolved

1 Like