How to fix Callback info about the 'Elixir.Ecto.Repo' behaviour is not available

Hi, I have an error in my project that says fix Callback info about the 'Elixir.Ecto.Repo' behaviour is not available in my Repo file.

I couldn’t find anything to fix it in Ecto doc
https://hexdocs.pm/ecto/Ecto.Repo.html

and I saw this post:

Thanks

If you run dialyzer manually does the error occur as well?

If yes, can you please show relevant sections of your mix.exs?

1 Like

Hi, I haven’t installed dialyzer yet in my project, I just see this problem in Vscode

do I install this and test ?

my mix file without dialyzer:

defmodule AuthService.MixProject do
  use Mix.Project

  def project do
    [
      app: :auth_service,
      version: "0.1.0",
      build_path: "../../_build",
      config_path: "../../config/config.exs",
      deps_path: "../../deps",
      lockfile: "../../mix.lock",
      elixir: "~> 1.10.2",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger],
      mod: {AuthService.Application, []}
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      {:ecto, "~> 3.3"},
      {:ecto_sql, "~> 3.3"},
      {:postgrex, "~> 0.15.3"},
      {:guardian, "~> 2.0"},
      {:oauth2, "~> 2.0", override: true},
      {:ueberauth, "~> 0.6.2"},
      {:ueberauth_google, "~> 0.9.0"},
      {:ueberauth_github, "~> 0.8.0"},
      {:jose, "~> 1.10"},
      {:comeonin, "~> 5.2"},
      {:bcrypt_elixir, "~> 2.1"}
      # {:sibling_app_in_umbrella, in_umbrella: true}
    ]
  end
end

Yes, add it as a dependency (only: :dev). Then run mix dialyzer.

If you see errors in your editor, always try to reproduce them on the terminal as well. Sometimes editors get a somewhat weird view on your project that is not in a consistent state.


Also, is this an umbrella? I think I remember there have been problems in umbrellas with some features of the LS.

1 Like

yes it is, I installed it in my main mix.exs file and ran mix dialyzer

it shows me errors

lib/phoenix/router.ex:2:no_return
Function call/2 has no local return.
________________________________________________________________________________
lib/phoenix/router.ex:2:no_return
Function call/2 has no local return.
________________________________________________________________________________
lib/phoenix/router.ex:331:pattern_match_cov
The pattern
variable_

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

________________________________________________________________________________
lib/phoenix/router.ex:331: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

That file has no error but my router lib file has errors :frowning:

I searched this error, and they suggested to skip this error

Depending on your exact versions used, you might hit some bug in the phoenix router…

Maybe related list of dialyzer/router issues

1 Like

all of the Phoenix projects under of my umbrella project are phoenix 1.4.16

Is lib/phoenix/router.ex your file? Or from phoenix? Feels weird to see warnings from dependencies…

I’d also consider using the dialyxir project, it seems to handle things like umbrella projects better in my experience.

1 Like

I think it is phoenix file because I don’t have 331 lines in my project, :frowning: