Following some tutorials on phoenix I always find myself to correct this small difference between phoenix 1.3 and 1.4
function Routes.static_path/2 is undefined
the way to fix ift is quite simple:
The blog was set up using this [post.](https://blog.bitsrc.io/build-your-own-blog-using-gatsby-and-react-a1255a5ab086)
Now I can start to write posts
+++ b/lib/myapp_web.ex
@@ -41,7 +41,7 @@ defmodule WMyAppWeb do
import MyAppWeb.ErrorHelpers
import MyAppWeb.Gettext
- alias MyAppWeb.Router.Helpers, as: Routes
+ import MyAppWeb.Router.Helpers
end
end
We just import the routes helpers instead aliasing the module. After this we still wil get an error because of the existing routes genetated by phoenix:
warning: function Routes.static_path/2 is undefined (module Routes is not available)
to get rid of that:
find lib/myapp_web/templates -type f -exec \ sed -i 's/Routes.statc/statc/g' {} +
Which will replace the exidsting route function calls