Closed noozo closed 1 year ago
It seems we can no longer rely on Application.ensure_loaded/1
when running the surface compiler on Elixir v1.15
. It appears it only runs successfully when the Elixir compiler, which runs previously, actually compiles something, not when it returns :noop
.
I could reproduce this by running mix compile
twice on a clean project. The compilation works the first time (since the elixir compiler also runs) but it fails the second time as it now returns :noop
. If you change any .ex
file and run mix compile
again, it works normally.
@josevalim this behavior seems inconsistent. I wonder if this was intended or a new bug. In case it was intended, is there any other way around to ensure the module is loaded when running a custom compiler?
For context, I need to load the application (modules) in order to introspect information about the components.
This is fixed in Elixir main and v1.15 branches. :) So hold on tight!
Actually, please give main and v1.15 branches a try. It seems this one is slightly different than the one I fixed.
I just tried it out using main
as well as v1.15
and they both work just fine!
I guess all we have to do is wait for a new release :)
@josevalim thank you! 💜
Closing this one as the issue has already been fixed. Confirmed using 1.15.2-otp-26
. Thank you again, José!
Describe the bug
With Elixir 1.15.0 a phoenix app using surface will not start up:
Your Environment
Surface: v0.11.0 LiveView: v0.19.2 Elixir: v1.15.0