surface-ui / surface

A server-side rendering component library for Phoenix
https://surface-ui.org
MIT License
2.08k stars 150 forks source link

(ArgumentError) defdelegate function is calling itself on elixir 1.14 with otp 25 #608

Closed dkuku closed 2 years ago

dkuku commented 2 years ago

Describe the bug

I upgraded otp and elixir versions in a project and I'm getting this error on compilation:

Compiling 130 files (.ex)

== Compilation error in file lib/surface/type_handler/default.ex ==
** (ArgumentError) defdelegate function is calling itself, which will lead to an infinite loop. You should either change the value of the :to option or specify the :as option
    (elixir 1.14.0-dev) lib/kernel/utils.ex:32: Kernel.Utils.defdelegate_all/3
    lib/surface/type_handler/default.ex:4: (module)
    (elixir 1.14.0-dev) lib/kernel/parallel_compiler.ex:346: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/7
could not compile dependency :surface, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile surface", update it with "mix deps.update surface" or clean it with "mix deps.clean surface"

How to reproduce it

  1. install elixir 1.14-dev and otp 25

The behavior you expected

Your Environment

"surface": :surface, "0.7.4", "phoenix_live_view": :phoenix_live_view, "0.17.10", elixir - current main

msaraiva commented 2 years ago

Fixed in c2b4081c37603619e80a41eb3395b20e338129c7.

msaraiva commented 2 years ago

Fixed in c2b4081c37603619e80a41eb3395b20e338129c7.

VictorGaiva commented 2 years ago

@msaraiva Would it make sense to already publish this change to hex under 0.7.6?

msaraiva commented 2 years ago

Just released v0.7.6 with that fix.