Confusing error when trying to start Genserver for multi-node testing

Hey @hubertlepicki, thank you for the suggestion.

Here’s an updated snippet(rest unchanged):

    :os.cmd('epmd -daemon')
    Node.start(:test@localhost, :shortnames) |> IO.inspect(label: "main")

    children = ['child_1', 'child_2', 'child_3']

    for child <- children do
      {:ok, node} = :slave.start_link(:localhost, child) |> IO.inspect(label: "start #{child}")
      Node.spawn(node, Supervisor, :init, [
        [{App.Cluster.Tasks, {}}],
        [strategy: :one_for_one]
      ]) |> IO.inspect(label: "spawn #{child}")
    end

And the result:

main: {:ok, #PID<0.999.0>}
start child_1: {:ok, :child_1@localhost}
spawn child_1: #PID<37450.88.0>

23:19:48.050 [error] Process #PID<37450.88.0> on node :child_1@localhost raised an exception
** (UndefinedFunctionError) function Supervisor.init/2 is undefined or private
    (elixir) Supervisor.init([{Distributor.Cluster.Tasks, {}}], [strategy: :one_for_one])

It seems particularly odd because the error is complaining that Supervisor.init/2 doesn’t exist. If there was a match error I’d have something to work on. Does this code somehow fail to load my modules in the other nodes?