Using wx in an escript (with rebar3)

Hi all,

I am trying to build an escript that runs a wx GUI.

I added wx in my rebar.config, this is how it looks:

{erl_opts, [no_debug_info]}.

{deps, [{egd, {git, "https://github.com/erlang/egd.git", {branch, "master"}}}]}.

{escript_incl_apps, [wx]}.
{escript_main_app, edenticon}.
{escript_name, edenticon}.
{escript_emu_args, "%%! +sbtu +A1"}.

The error I got is:

=CRASH REPORT==== 9-Nov-2024::10:44:15.191663 ===
  crasher:
    initial call: wxe_master:init/1
    pid: <0.90.0>
    registered_name: []
    exception error: {load_driver,"No driver found"}
      in function  wxe_util:priv_dir/2 (wxe_util.erl, line 190)
      in call from wxe_util:init_nif/1 (wxe_util.erl, line 58)
      in call from wxe_master:init/1 (wxe_master.erl, line 114)
      in call from gen_server:init_it/2 (gen_server.erl, line 980)
      in call from gen_server:init_it/6 (gen_server.erl, line 935)
    ancestors: [<0.89.0>,<0.9.0>]
    message_queue_len: 0
    messages: []
    links: []
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 1598
    stack_size: 28
    reductions: 1433
  neighbours:

escript: exception error: {load_driver,"No driver found"}
  in function  wxe_server:start/1 (wxe_server.erl, line 65)
  in call from wx:new/1 (wx.erl, line 115)
  in call from edenticon_gui:run/1 (/home/carloratm/w/identicon/src/edenticon_gui.erl, line 9)
  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 

No driver found looks like I am missing some sys lib?
But then, why running wx:demo(). from the rebar3 shell works fine?

Cheers!