Search code examples
elixirphoenix-frameworkelixir-mix

Adding 'timex v3.7' fails Phoenix service to start for 'parse_trans_codegen'


Reason:

I was missing erlang-syntax_tools package.

When I try it on a container, there is no issue... will close the issue.

I'm using latest package, will re-install or just use container for the while.


Steps to reproduce

  • when I add {:timex, "~> 3.7"} to a new Phoenix project created for learning and try start service with mix deps.get && iex -S mix phx.server, it fails with following errors...
Erlang/OTP 24 [erts-12.3.2.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

===> Analyzing applications...
===> Compiling parse_trans
===> Compiling src/exprecs.erl failed
src/exprecs.erl:none: error in parse transform 'parse_trans_codegen':
exception error: undefined function erl_syntax:string/1
  in function  parse_trans:get_file/1 (LOCAL_PATH/calendo/deps/parse_trans/src/parse_trans.erl, line 227)
  in call from parse_trans:initial_context/2 (/LOCAL_PATH/calendo/deps/parse_trans/src/parse_trans.erl, line 299)
  in call from parse_trans_codegen:parse_transform/2 (LOCAL_PATH/calendo/deps/parse_trans/src/parse_trans_codegen.erl, line 147)
  in call from compile:foldl_transform/3 (compile.erl, line 1147)
  in call from compile:fold_comp/4 (compile.erl, line 418)
  in call from compile:internal_comp/5 (compile.erl, line 402)
  in call from compile:'-internal_fun/2-anonymous-0-'/2 (compile.erl, line 229)

even doing mix deps.compile prase_trans or deps.clean & deps.get fails

My local setup is OTP 24, Elixir 1.13.4, Phoenix 1.6.10, rebar 3.19.0, Erts 12.3.2.1 and entire app code is here. Just adding timex dependency to it and starting service causes this issue.

Description of issue

The error occur as soon I add timex dep to mix and run service without any extra code. So it gets introduced by one of the constructs from it. The error is weird since erl_syntax:string/1 seems to be a valid call which gets notified as undefined in error stack.


Solution

  • Installing package erlang-syntax_tools fixed the issue with parse_trans required in timex.