You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can create a new module constant @env to fetch the value at compile time
and check the value afterwards in runtime. Since Mix would no be available in runtime
at production release.
@clsource Thanks for the report, mix surface.init --catalogue generates if Mix.env() == :dev do at the module level (compile time) exactly as your suggested fix.
Did you run into any errors trying to run the original code? Or changed the Router somehow? Can you share more details to reproduce the error?
Describe the bug
When using
It creates a new route in
router.ex
with the catalogue routes.But it is using
Mix.env()
to check these routes.Possible Fix
We can create a new module constant
@env
to fetch the value at compile timeand check the value afterwards in runtime. Since
Mix
would no be available in runtimeat production release.
Your Environment
Surface: v0.11.1
LiveView: v0.19.0
Elixir: v1.14
The text was updated successfully, but these errors were encountered: