Escript: exception error: undefined function erlang:get_stacktrace/0

elixir -v

Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [dtrace]

Elixir 1.8.2 (compiled with Erlang/OTP 24)

~/.mix/rebar3 --version

rebar 3.13.3 on Erlang/OTP 24 Erts 12.0.3

Error I am getting while compiling lz4

===> Fetching pc v1.13.0
===> Downloaded package, caching at /Users/sahilpaudel/.cache/rebar3/hex/hexpm/packages/pc-1.13.0.tar
escript: exception error: undefined function erlang:get_stacktrace/0
  in function  rebar3:main/1 (/rebar3/src/rebar3.erl, line 72)
  in call from escript:run/2 (escript.erl, line 750)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1 
  in call from init:do_boot/3 
** (Mix) Could not compile dependency :lz4, "/Users/sahilpaudel/.mix/rebar3 bare compile --paths "/Users/sahilpaudel/Documents/Elixir/diamond/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile lz4", update it with "mix deps.update lz4" or clean it with "mix deps.clean lz4"

Try upgrading your rebar with mix local.rebar, erlang:get_stacktrace/0 was removed in OTP 24.

6 Likes

Additionally Elixir 1.8 only supports up to Erlang/OTP 22 so you should either upgrade Elixir (preferable) or downgrade Erlang/OTP.

Source: Compatibility and Deprecations — Elixir v1.13.0-dev

1 Like