Skip to content

Commit

Permalink
Ensure modules are loaded in embedded mode
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrocp committed Jul 4, 2024
1 parent 1930dc6 commit ffbfb3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/beacon/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ defmodule Beacon.Compiler do
defp do_compile_and_load(quoted, file, failure_count \\ 0) do
[{module, _}] = Code.compile_quoted(quoted, file)

case Code.ensure_loaded(module) do
{:module, ^module} -> {:ok, module}
error -> error
case :code.ensure_modules_loaded([module]) do
:ok -> {:ok, module}
{:error, [{_, error}]} -> {:error, error}
end
rescue
error in CompileError ->
Expand Down

0 comments on commit ffbfb3d

Please sign in to comment.