title: phoenix view module not available
body: <p>My application works and api json requests and for regular html. My router.ex</p>
  
  <pre><code>defmodule MyApp.Router do
    use MyApp.Web, :router
  
    pipeline :browser do
      plug :accepts, ["html"]
      plug :fetch_session
      plug :fetch_flash
      plug :protect_from_forgery
      plug :put_secure_browser_headers
    end
  
    pipeline :api do
      plug :accepts, ["json"]
    end
  
    scope "/api", MyApp do
      pipe_through :api # Use the default browser stack
  
      scope "/v1", V1, as: :v1 do
        resources "/users", UserController, except: [:new, :edit, :index]
      end
    end
  
    scope "/", MyApp do
      pipe_through :browser # Use the default browser stack
      get "/confirm/:token",          UserController, :confirm, as: :user_confirm
    end
  
  end
  </code></pre>
  
  <p>my web/controllers/v1/user_controller.ex</p>
  
  <pre><code>defmodule MyApp.V1.UserController do
    use MyApp.Web, :controller
  
    def create(conn, %{"user" =&gt; user_params}) do
     ...
            conn
            |&gt; put_status(:created)
            |&gt; put_resp_header("location", v1_user_path(conn, :show, user))
            |&gt; render("sign_up.json", user: Map.put(user, :session, result[:session]))
     ...
    end
  </code></pre>
  
  <p>and my web/controllers/user_controller.rb</p>
  
  <pre><code>defmodule MyApp.UserController do
    use MyApp.Web, :controller
  
    alias MyApp.User
  
    def confirm(conn, %{"token" =&gt; token}) do
  ...
              render(conn, "confirmed.html")
  ...
    end
  
  end
  </code></pre>
  
  <p>my web/views/v1/user_view.ex</p>
  
  <pre><code>defmodule MyApp.V1.UserView do
    use MyApp.Web, :view
  ...
  end
  </code></pre>
  
  <p>and my web/views/user_view.ex</p>
  
  <pre><code>defmodule MyApp.UserView do
    use MyApp.Web, :view
  
  end
  </code></pre>
  
  <p>Everything works fine until I added a route and a controller for html.
  Now, when I make a request for api json, I get an error</p>
  
  <pre><code>Request: POST /api/v1/users
  ** (exit) an exception was raised:
      ** (UndefinedFunctionError) function MyApp.V1.UserView.render/2 is undefined (module MyApp.V1.UserView is not available)
  </code></pre>
  
  <p>But if I delete web/vews/user_view.ex, then this query works without errors.
  How can you correct this error?</p>