Warning: Code.ensure_compiled?/1 is deprecated

warning: Code.ensure_compiled?/1 is deprecated. Use Code.ensure_compiled/1 instead (see the proper disclaimers in its docs)
  lib/ecto/association.ex:827: Ecto.Association.BelongsTo.after_compile_validation/2

warning: Code.ensure_compiled?/1 is deprecated. Use Code.ensure_compiled/1 instead (see the proper disclaimers in its docs)
Found at 2 locations:
  lib/ecto/association.ex:982: Ecto.Association.ManyToMany.after_compile_validation/2
  lib/ecto/association.ex:988: Ecto.Association.ManyToMany.after_compile_validation/2

warning: Code.ensure_compiled?/1 is deprecated. Use Code.ensure_compiled/1 instead (see the proper disclaimers in its docs)
  lib/ecto/repo/supervisor.ex:69: Ecto.Repo.Supervisor.compile_config/2

warning: Code.ensure_compiled?/1 is deprecated. Use Code.ensure_compiled/1 instead (see the proper disclaimers in its docs)
  lib/ecto/association.ex:529: Ecto.Association.Has.after_compile_validation/2

warning: Code.ensure_compiled?/1 is deprecated. Use Code.ensure_compiled/1 instead (see the proper disclaimers in its docs)
  lib/ecto/schema.ex:2011: Ecto.Schema.check_field_type!/3

warning: Code.load_file/1 is deprecated. Use Code.require_file/2 or Code.compile_file/2 instead
  lib/ecto/migrator.ex:590: Ecto.Migrator.load_migration!/1

What’s the best way to resolve these?

Reading the documentation of the proposed replacement functions and use those in a way that is appropriate in your context.

1 Like

None of the modules I’ve written contain calls to those functions though . . .

It’s within ecto, what version of ecto are you using?

That makes sense.

Here’s the version we’re using:

{:ecto_sql, "~> 3.2.0"}

Latest version is 3.4.4, perhaps try upgrading?

Excellent! Thanks for your help :slight_smile:

Btw, is there a way to receive notifications when updated versions of any dependencies we’re using get published?

These guys will even create an automatic pull request for you with the update: https://depfu.com

We use them at work and it works great.

That looks very useful, thank you so much for the recommendation! :slight_smile:

How are you guys integrating it with your mix projects?

defp deps do
		[
			{:httpoison, "~> 1.6"},
			{:poison, "~> 4.0"},
			{:postgrex, "~> 0.15.1"},
			{:ecto_sql, "~> 3.4.4,"},
			{:gen_stage, "~> 1.0"},
			{:broadway, "~> 0.6.0"}
		]
	end
$ mix deps.get
** (Hex.Version.InvalidRequirementError) invalid requirement: "~> 3.4.4,"
    (hex 0.20.5) lib/hex/version.ex:134: Hex.Version.parse_requirement!/2
    (hex 0.20.5) lib/hex/version.ex:52: anonymous fn/3 in Hex.Version.match?/3
    (hex 0.20.5) lib/hex/version.ex:144: Hex.Version.cache/2
    (hex 0.20.5) lib/hex/remote_converger.ex:532: anonymous fn/2 in Hex.RemoteConverger.unlock_deps/2
    (elixir 1.10.3) lib/enum.ex:3291: Enum.filter_list/2
    (hex 0.20.5) lib/hex/remote_converger.ex:526: Hex.RemoteConverger.unlock_deps/2
    (hex 0.20.5) lib/hex/remote_converger.ex:515: Hex.RemoteConverger.prepare_locked/3
    (hex 0.20.5) lib/hex/remote_converger.ex:38: Hex.RemoteConverger.converge/2

What am I missing?

You have an extra comma in this: "~> 3.4.4,"

Thanks man! :slight_smile:

They have integrations for GitHub or GitLab. And support Elixir, Ruby and Node projects out of the box. There is no special mix integration.

Gotcha! How would you recommend I use this with my mix project, then? :slight_smile:

I would recommend to read how it works, and decide if you need it or not. Then try to follow the docs and if you have problems to set it up, then ask either Depfu support, or here :slight_smile:

GitHub also has Dependabot, which comes for free. It works quite well, especially on apps that have a good test coverage, as you can automatically test pull requests created by the bot to test compatibility with new versions of dependencies. I actually never used it with Elixir, but I see that it supports it.

1 Like

Thanks for your suggestion!

I even found this clear walkthrough on how to integrate it with an existing project. Thanks again! :slight_smile: