You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code in Elixir is compiled asynchronously. Therefore, loading all modules in compile times is not possible (because most modules are not even compiled yet), so some invocation of emit macro will just fail, because they will relate to the event of the not-yet compiled module
The text was updated successfully, but these errors were encountered:
Hmm.. I'll try to reproduce this in our codebase! I admit at Vetspire we primarily rely on the @decorate and @decorate_all macros which don't need to bother doing any compile time checks because they define their own events.
Do you think some fix might be just adding a Code.ensure_compiled!/1 call to the emit/N macro? If I understand correctly this should cause module compilation to pause and await the ensure_compiled module is compiled and loaded no?
Some module will be compiled first, and some module will be compiled second, therefore some function will be unable to check if event exists and defined
Overall, this issue can't be fixed. So the best approach would be to disable event? check or make it a runtime check or find some other way to check for existing event (like defining them in config.exs or such)
Code in Elixir is compiled asynchronously. Therefore, loading all modules in compile times is not possible (because most modules are not even compiled yet), so some invocation of
emit
macro will just fail, because they will relate to the event of the not-yet compiled moduleThe text was updated successfully, but these errors were encountered: