crawly icon indicating copy to clipboard operation
crawly copied to clipboard

ex_json_schema compile error

Open maiphuong-van opened this issue 7 months ago • 5 comments

I added crawly to my deps and get this error while compiling

==> ex_json_schema
Compiling 39 files (.ex)

== Compilation error in file lib/ex_json_schema/validator/format.ex ==
** (ArgumentError) cannot inject attribute @formats into function/macro because cannot escape #Reference<0.3458749000.2345271301.41352>. The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
    (elixir 1.18.4) lib/kernel.ex:3777: Kernel.do_at_escape/2
    (elixir 1.18.4) expanding macro: Kernel.@/1
    lib/ex_json_schema/validator/format.ex:86: ExJsonSchema.Validator.Format.do_validate/3
could not compile dependency :ex_json_schema, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ex_json_schema --force", update it with "mix deps.update ex_json_schema" or clean it with "mix deps.clean ex_json_schema"

Adding this line in mix deps solved the issue.

{:ex_json_schema, "~> 0.11.1", override: true}

maiphuong-van avatar Jun 13 '25 08:06 maiphuong-van

Do you have a theory what the problem is?

dogweather avatar Jul 15 '25 21:07 dogweather

Do you have a theory what the problem is?

Do you also have this problem? As I could not reproduce it, despite of using Crawly together with @maiphuong-van on a project.

oltarasenko avatar Jul 16 '25 13:07 oltarasenko

@oltarasenko Nope, I don't have the problem.

dogweather avatar Jul 17 '25 21:07 dogweather

I had this problem with OTP28 - dropped back to OTP27 for both erlang and elixir.

tymoor avatar Aug 13 '25 22:08 tymoor

@oltarasenko I found that when I started setting up with what we were doing, adding the overrides solved the problem. Might be just before we paired up.

And my Elixir n Erlang version are

elixir          1.18.4-otp-28
erlang          28.0      

So maybe it's something with the OTP version 🤔

maiphuong-van avatar Aug 14 '25 14:08 maiphuong-van