Reputation: 2896
I upgraded Phoenix from 1.1.6 to 1.2 and now I'm getting this weird CompileError.
(CompileError) web/views/main_view.ex:2: module Rejack.Router.Helpers is not loaded and could not be found
I compared a freshly generated Phoenix 1.2 project file by file to mine and I couldn't find any major differences.
The view
part my web.ex
looks like this:
def view do
quote do
require Logger
use Phoenix.View, root: "web/templates"
# Import convenience functions from controllers
import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1]
# Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML
import Rejack.Router.Helpers
import Rejack.ErrorHelpers
import Rejack.Gettext
end
end
and the view is also pretty standard
defmodule Rejack.MainView do
use Rejack.Web, :view
end
Any idea what is causing this?
Edit:
The only major difference to a regular Phoenix project is that I'm not using postgrex
, but mongodb_ecto
(and therefor I'm stuck with phoenix_ecto
2.x).
Upvotes: 2
Views: 142
Reputation: 393
This could be down to using "forward" as a catch all in your routes that's pointing to a controller rather than a Plug.
forward "/", PageController, :index
If you do have that in your routes and you change it to use get "/*path" instead, that should fix the compilation errors for you.
get "/*path", PageController, :index
Upvotes: 1