4

I'm testing this https://github.com/saleyn/erws_example on R16B03 (both on windows & Ubuntu)

==> erws_example (compile)
src/erws_handler.erl:none: undefined parse transform 'lager_transform'
ERROR: compile failed while processing /home/charles/erws_example: rebar_abort

I've seen this suggestion http://philipcristiano.com/2013/05/27/ordering-of-rebar-dependencies.html

So far, i'm unable to get any headway.

Thanks.

Charles Okwuagwu
  • 10,538
  • 16
  • 87
  • 157
  • 2
    You got error `undefined parse transform 'lager_transform'` because of option `{erl_opts, [{parse_transform, lager_transform}]}.` in your rebar.conf file. It says that parse transform will be applied to each module during compilation. But lager_transform function is defined in lager modules which is not yet compiled itself. So probably you should compile lager project manually to avoid this error. – sergeyz Dec 28 '13 at 16:09

2 Answers2

3

It seems rebar can not compile parse transforms before compiling everything else (https://github.com/basho/rebar/issues/270). The solution is to compile module with parse transform manually or use file-level parse_transform compiler directive instead of project level.

sergeyz
  • 1,308
  • 2
  • 14
  • 23
  • Using elixir with a dependency on chatterbox, I had to do the following: ``` mix deps.compile lager mix deps.compile chatterbox ``` – Olshansky Aug 24 '17 at 17:21
3

Try to put lager to first position in rebar dependency list. it will fix it. rebar ordering compile dependencies according to this list, not dependency tree))

Mike
  • 47
  • 1