添加'timex v3.7'会使凤凰城服务无法启动'parse_trans_codegen'



原因:

我丢失了erlang-syntax_tools包。

当我在容器上尝试时,没有问题。。。将结束该问题。

我正在使用最新的软件包,将重新安装或暂时只使用容器。


复制的步骤

  • 当我将{:timex,"~>3.7"}添加到为学习而创建的新Phoenix项目中并尝试使用mix deps.get && iex -S mix phx.server启动服务时,它失败了,并出现以下错误
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)

甚至混合deps.compile prase_trans或deps.clean&deps.get失败

我的本地设置是OTP 24、Elixir 1.13.4、Phoenix 1.6.10、rebar 3.19.0、Erts 12.3.2.1,整个应用程序代码都在这里。仅向其添加timex依赖项并启动服务就会导致此问题。

问题描述

当我在没有任何额外代码的情况下将timexdep添加到混合并运行服务时,就会出现错误。所以它是由它的一个构造引入的。这个错误很奇怪,因为erl_syntax:string/1似乎是一个有效的调用,它在错误堆栈中被通知为未定义。

安装包erlang-syntax_tools修复了timex中所需的parse_trans问题。

最新更新