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

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