Elixir 1.16 / OTP 26 on MacOS Tahoe - (ArgumentError) cannot escape #Reference <...>

Has anyone gotten Elixir 1.16 on OTP 26 working on MacOS Tahoe? Everything worked fine for me on MacOS Sequoia, but after upgrading to Tahoe I am getting the following error:

** (ArgumentError) cannot escape #Reference<0.1269299311.3360555009.56098>. The supported values are: lists, tuples, maps, atoms, numbers, bitstrings, PIDs and remote functions in the format &Mod.fun/arity
    (elixir 1.16.3) src/elixir_quote.erl:523: :elixir_quote.argument_error/1
    (elixir 1.16.3) src/elixir_quote.erl:429: :elixir_quote.do_quote_simple_list/4
    (elixir 1.16.3) src/elixir_quote.erl:429: :elixir_quote.do_quote_simple_list/4
    (elixir 1.16.3) src/elixir_quote.erl:152: :elixir_quote.do_escape/3
    (elixir 1.16.3) src/elixir_quote.erl:375: :elixir_quote.do_quote/3
    (elixir 1.16.3) src/elixir_quote.erl:429: :elixir_quote.do_quote_simple_list/4
    (elixir 1.16.3) src/elixir_quote.erl:429: :elixir_quote.do_quote_simple_list/4
    /../config.exs:196: (file)

Line 196 in config.exs is

import_config "#{Mix.env()}.exs"

In the config file it loads, I tracked this down to:

config :app, App.Endpoint,
  live_reload: [
    patterns: [
      ~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
      ~r{priv/gettext/.*(po)$},
      ~r{lib/app_web/views/.*(ex)$},
      ~r{lib/app_web/templates/.*(eex)$}
    ]
  ],

If I remove the patterns, it works. However, I then get a new error:

 mix deps.get

15:32:17.371 \[error\] beam/beam_load.c(594): Error loading function ‘Elixir.Hex.State’:print_invalid_config_error/2: op bs_add p x x u x:
please re-compile this module with an Erlang/OTP 28 compiler or update your Erlang/OTP version

Is there any way to get Elixir 1.16 / OTP 26 working on MacOS Tahoe?

Welcome! What’s the output of elixir --version? The error message let’s me think that it’s not 1.16 because when it was released there was no OTP 28 available

5 Likes

Oh man, I can’t believe I missed this… I had erlang installed from both asdf and homebrew, and the homebrew path was taking precedence over asdf so it was trying to run 1.16 on OTP 28 even though asdf current showed the expected values.

After fixing the path everything seems to be working as expected now. Thanks for the quick rubber ducking!

5 Likes