Hello,
I’m trying to upgrade a pretty large project from Elixir 1.18.4 to Elixir 1.19.1 (1321 modules), but seeing some compiler warnings saying modules aren’t available.
These show with both OTP 27 and OTP 28, so I’m guessing it’s related to Elixir 1.19 changes rather than OTP.
Erlang/OTP 28 [erts-16.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]
warning: you are implementing a protocol for Foobar.Resources.User.V2.Api but said module is not available. Make sure the module name is correct. If Foobar.Resources.User.V2.Api is an optional dependency, please wrap the protocol implementation in a Code.ensure_loaded?(Foobar.Resources.User.V2.Api) check
│
43 │ defimpl Bamboo.Formatter, for: Foobar.Resources.User.V2.Api do
│ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
│
└─ lib/foobar/email/recipient.ex:43: (file)
warning: you are implementing a protocol for Foobar.Resources.Baz.V1.Api but said module is not available. Make sure the module name is correct. If Foobar.Resources.Baz.V1.Api is an optional dependency, please wrap the protocol implementation in a Code.ensure_loaded?(Foobar.Resources.Baz.V1.Api) check
│
49 │ defimpl FunWithFlags.Group, for: Foobar.Resources.Baz.V1.Api do
│ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
│
└─ lib/foobar/feature_flags/group.ex:49: (file)
The modules exist, so I’m not sure why defimpl is throwing warnings or why only these two, we have dozens more that look near identical that don’t.
We’re also seeing extra warnings when running tests, from some modules only compiled for tests, through elixirc_paths config like this:
defp elixirc_paths(:test), do: elixirc_paths(:dev) ++ ["test/support", "test/resources", "test/benchmarks"]
defp elixirc_paths(_), do: ["lib", "web"]
warning: invalid association `test_comment_test_categories` in schema Foobar.Test.Support.Framework.Resources.TestCategory.V1.Api: associated schema Foobar.Test.Support.Framework.Resources.TestCategory.V1.JoinTables.TestCommentTestCategory does not have field `api_id`
└─ test/support/framework/resources/test_category/v1/api.ex: Foobar.Test.Support.Framework.Resources.TestCategory.V1.Api (module)
warning: invalid association `test_editor_test_posts` in schema Foobar.Test.Support.Framework.Resources.TestPost.V1.Api: associated schema Foobar.Test.Support.Framework.Resources.TestPost.V1.JoinTables.TestEditorTestPost does not have field `api_id`
└─ test/support/framework/resources/test_post/v1/api.ex: Foobar.Test.Support.Framework.Resources.TestPost.V1.Api (module)
warning: invalid association `test_editor_test_posts` in schema Foobar.Test.Support.Framework.Resources.TestEditor.V1.Api: associated schema Foobar.Test.Support.Framework.Resources.TestEditor.V1.JoinTables.TestEditorTestPost does not have field `api_id`
└─ test/support/framework/resources/test_editor/v1/api.ex: Foobar.Test.Support.Framework.Resources.TestEditor.V1.Api (module)
warning: invalid association `test_comment_test_categories` in schema Foobar.Test.Support.Framework.Resources.TestComment.V1.Api: associated schema Foobar.Test.Support.Framework.Resources.TestComment.V1.JoinTables.TestCommentTestCategory does not have field `api_id`
└─ test/support/framework/resources/test_comment/v1/api.ex: Foobar.Test.Support.Framework.Resources.TestComment.V1.Api (module)
warning: invalid association `test_post_test_categories` in schema Foobar.Test.Support.Framework.Resources.TestPost.V1.Api: associated schema Foobar.Test.Support.Framework.Resources.TestPost.V1.JoinTables.TestPostTestCategory does not have field `api_id`
└─ test/support/framework/resources/test_post/v1/api.ex: Foobar.Test.Support.Framework.Resources.TestPost.V1.Api (module)
warning: invalid association `test_post_test_categories` in schema Foobar.Test.Support.Framework.Resources.TestCategory.V1.Api: associated schema Foobar.Test.Support.Framework.Resources.TestCategory.V1.JoinTables.TestPostTestCategory does not have field `api_id`
└─ test/support/framework/resources/test_category/v1/api.ex: Foobar.Test.Support.Framework.Resources.TestCategory.V1.Api (module)
These are for our internal framework tests and are causing over 100 test failures.
Everything compiled with no warnings with Elixir 1.18.4, and no test errors.
Our internal framework is pretty macro heavy, so maybe some behavior changed there?
All those JoinTables modules are dynamically created by our framework through macros, but only the test/support ones are failing.
If it was totally broken, I’d expect to see test failures or warnings for our actual application rather than only this framework code.
Not really sure where to start looking. Any ideas?
Thanks




















