Closed Ilyushya closed 1 year ago
Can you share your entire router file? The double alias prefix of IntellieractiveWeb
looks like you have a nested scope in your router? Thanks!
This is a new project, so my router file is almost just regular:
I've made some research and realised that a Phoenix project breaks after I transfer files using explorer. There is definetily something wrong with FS changes watcher or live code reloader because it's already the 2nd time I encounter disability to use Phoenix after I import my html (the first time it was saying that there are no such html files)
You need to remove the alias
lines in your router. scope "/", MyWeb
will already providing the alias prefix to all modules within that scope, so drop the alias and you are good to go!
Thank you! I wonder how they got there
For what it's worth, I've just come into this same issue after having generated a Controller etc. using mix phx.gen.html
. Playing things back using undo/redo, it looks like the alias MyAppWeb.MyController
was automatically added to my router.ex
by VSCode (or rather, the ElixirLS plugin I suppose) when I manually typed/used Intellisense to add resources "/path", MyController
to my scope
.
Environment
Operating system: Windows 10
At first a message that said that there is no
init
method in my controllers appeared. Then it started saying my controller modules are not defined or unreachable. It suddenly started behaving so and even reinstalling all the things does not help.The controllers are newly generated, using mix
phx.gen.html
, so I guess the problem is not in my code.