Hello,
Finally we got a time to migrate from Phoenix 1.2 to Phoenix 1.3 and there some really enjoyable moments in that process but unfortunately it was blocked by the following problem: using a plug
with a router helper inside the controller cause a cache access error.
controller
defmodule FlowmailWeb.SubscriptionSettingsController do
use FlowmailWeb, :controller
plug CheckNewsletterSettings, [redirect_path: subscription_settings_path(FlowmailWeb.Endpoint, :edit)]
backtrace
** (ArgumentError) argument error
(stdlib) :ets.lookup(FlowmailWeb.Endpoint, :__phoenix_path__)
(phoenix) lib/phoenix/config.ex:47: Phoenix.Config.cache/3
lib/phoenix/endpoint.ex:643: FlowmailWeb.Endpoint.path/1
lib/flowmail_web/controllers/subscription_settings_controller.ex:14: (module)
I suspect that it’s because of the :ets.lookup
tries to access non-existing table which is being created only in the runtime https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/config.ex#L102
I assume that it can’t be a bug in Phoenix and I’m missing something in my update. Any ideas what it may be?