Basic routing/controllers/view/template throws error. I am following Phoenix tutorial

After years away I decided to jump back into phoenix and to try to learn it - again. I am following the “Getting started” tutorial. I am getting errors.

I posted the first query related to my post at StackOverflow.

The gentleman that commented said that I am not responsible for those errors and they are issues with Phoenix and code that phoenix relies on. They will be fixed in the next update.

After changing my server port number and refreshing, my initial problem seemed to correct itself. That is, until I decided to add another route.

I am following the official phoenix tutorial and I am at the part that begins at this header:

As far as I can tell, I have created the new route, controller and template to the specification of the tutorial.

I get the following error:

Could not render “show.html” for HelloWeb.HelloView, please define a matching clause for render/2 or define a template at “lib/hello_web/templates/hello/*”. The following templates were compiled:

Being that the last problem was not due to my code, I am unsure if my current problem is, or if this is just another problem with Phoenix.

I did some experimenting and found something odd. I’m new to Phoenix and Elixir too, so no idea what’s going on either :slight_smile:

I went through the same tutorial and got it working, so to get your error I deleted the show.html.heex file. I then restored the show.html.heex file and the error doesn’t get resolved despite it being restored to the previously working state.

By any chance have you put below in the Index.html.heex as well as the show.html.heex?

Hello World, from <%= @messenger %>!

I was lazy and copied it into both html.heex files the first time I did the tutorial and it failed. I deleted this from the index and show files then restarted the server everything started working again. Try deleting everything in both the html.heex files in the hello folder and restart your server to see if you can get the routes working as they don’t need any of the html information to work.

I commented out the contents of the index.html.heex file and it magically “fixed” the problem.

This is a big error on the part of the phoenix developers - or whomever is responsible for this part of the app. I am not sure how to reproduce the error otherwise I would put in a ticket at Github.
They’re probably already aware of it - hopefully!

Thank you!

If you haven’t seen this thread yet, give it a look. Might be related to the issue you ran into. Template not compiling, but I can see it in the correct directory. It's *right there*