Cannot Find Phoenix.Router, others in new Phoenix project.
See original GitHub issueIn Phoenix projects, use Phoneix.X gives a lint warning saying that it cannot find the proper module.
Steps to reproduce:
- Download Phoenix has per their instructions.
- mix phoenix.new Test /path/to/test
- cd /path/to/test
- mix deps.get
- mix compile
- subl /path/to/test/web/router.ex
See a red dot on line 2 with statement "Error: module Phoenix.Router is not loaded and cannot be found.
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Routing — Phoenix v1.6.15 - HexDocs
Phoenix provides an excellent tool for investigating routes in an application: ... The router supports other macros besides those for HTTP verbs like...
Read more >Phoenix.Router.NoRouteError for assets - Stack Overflow
in apps directory try to install phoenix project with this command mix phx.new phx_project --no-ecto. and trye to add assets with new ......
Read more >Creating a new Phoenix project | Phoenix Web Development
To get started on a project and generate the Phoenix application skeleton we'll need to start developing, we'll run a special command using...
Read more >Cannot load assets in Phoenix umbrella app - Elixir Forum
To do this I decided to add a phoenix project under the umbrella using: ... GET /assets/app.css 16:17:44.887 [debug] ** (Phoenix.Router.
Read more >Phoenix 1.7-rc released: Built-in Tailwind, Verified Routes ...
router get "/oauth/callbacks/:id", OAuthCallbackController, :new ... your router, and let you know when it can't find a matching route:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I had the same issue and discovered that the linter plugin cannot find the mix project. When
elixircruns, it doesn’t have a proper path where to find the modules.That happens because
find_mix_projectusesos.getcwdif no argument is given as a starting point. However, there’s no guarantee that the current directory will be the phoenix project (in my case, it was the Sublime Text package folder or some such). I fixed it by changing elixir_sublime.py and feedingfind_mix_projectthe file the linter is currently handling,self.filename:I’m not sure if this will break other stuff since I never wrote a sublime linter plugin (and that’s why I’m not making a PR), but it works for me.
yeah, I have the same problem with all my use statements.
Example: use Ecto.Repo, adapter: Ecto.Adapters.Postgres
I’m using Yosemite and I opened sublime in the project directory