Dialyzer error in a new Phoenix project

Hi everyone :slight_smile:

I have a project in which I’ve been using dialyzer. Everything worked fine until today, when, after adding Phoenix to the project, I received this error:

...
Total errors: 2, Skipped: 0, Unnecessary Skips: 0
done in 0m2.27s
lib/phoenix/router.ex:2:no_return
Function call/2 has no local return.
________________________________________________________________________________
lib/phoenix/router.ex:325:pattern_match_cov
The pattern
variable__

can never match, because previous clauses completely cover the type
:error.

________________________________________________________________________________
done (warnings were emitted)
Halting VM with exit status 2

So, I thought that the error was my fault due to add Phoenix after creating the Mix project.
Then I created a new Phoenix project (mix phx.new new_project --no-html --no-webpack) and I added dialyzer to it.
But, without adding anything else, I still receive the same error when running mix dialyzer --format dialyxir.

I’ve searched for this error and some time ago it happened to another dev.

Anyone who has already faced this?

Thanks a lot!!

3 Likes

I have a number of things related to phoenix in my dialyxir ignore list. Maybe they will accept PR fixes as it does seem there are some wrong things? ^.^

3 Likes

I’ve seen some PR related to this issue…
Let’s see if they can fix it in a while! :rescue_worker_helmet:

Meanwhile, I will have to ignore these files :+1:

Thanks!!

1 Like

I’m running into this as well. However, I’m not seeing any PR’s in the Phoenix GitHub repo. @xrodriguez would you mind linking to the PR’s that you saw?

Found this.

Looks like it’s only an issue when there are no routes.

This post details how to ignore warnings.

3 Likes

Hey!

Same issue I found, I think.

Best solution is to ignore warnings from dialyzer as you suggest.

Thank you so much for the reply!! :+1: