Update from Phoenix 1.4.9 to 1.4.17 -> Router.Helpers Problem

I tried to update from Phoenix 1.4.9 to 1.4.17 and when I try to start with the new Phoenix, I get a MyApp.Router.Helpers is not loaded and could not be found compile error.

When I reset the changes, it works again. I checked the changelog for any changes but I could not find anything. Does anyone know what changed so that I get this error now?

Try removing _build and see if it alleviates the problem. If not, then the best course of action is to isolate this issue into a smaller app that we can take a look at.

2 Likes

The _build removal did not fix it.

My web.ex looks like the following:

  def controller do
    quote do
      use Phoenix.Controller

      alias MyApp.Repo
      import Ecto
      import Ecto.Query

      import Bodyguard

      import MyApp.Router.Helpers
      import MyApp.Gettext
    end
  end

and then controllers look like the following:

defmodule MyApp.XYController do
  use MyApp.Web, :controller

The router uses that:

defmodule MyApp.Router do
  use MyApp.Web, :router

To me it looks like the module has been renamed or moved or whatever?

I just set up a new application and even using the import it worked. It might be related to using the old syntax?

I guess that the code update of the live view caused that.

After I had figured out that I among other things needed to replace the following, it worked again:

plug :fetch_flash
plug Phoenix.LiveView.Flash

by

import Phoenix.LiveView.Router
...
...
plug :fetch_live_flash