I’m getting this error during compilation for my latest Phoenix/Elixir release:
Nov 18 07:40:57 AM ** (CompileError) lib/seeker/parsing/dt_listing_parser.ex:87: cannot find or invoke local is_map_key/2 inside guard. Only macros can be invoked in a guard and they must be defined before their invocation
This has been supported in Elixir since v1.10 released in January and the only way I can reproduce this locally is falling back to an earlier version.
As far as I can tell, that is not true on my instance at compile time. To prove this, I updated my ./build.sh script to the following:
#!/usr/bin/env bash
# exit on error
set -o errexit
# output the version during compilation
elixir --version
mix deps.get --only prod
MIX_ENV=prod mix compile
# ... other steps don't matter here since the script doesn't get this far
The output of elixir --version is visible in the deploy logs on my application and outputs the following:
Nov 18 10:27:56 PM Erlang/OTP 22 [erts-10.7.2.5] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe]
Nov 18 10:27:56 PM
Nov 18 10:27:56 PM Elixir 1.9.4 (compiled with Erlang/OTP 22)
To answer your original question, I have to downgrade to a version before v1.10 to see the error since the ability to use is_map_key in a guard was added in v1.10
A second question which is much less urgent than my prior one above - if Render is currently defaulting to v1.10.2, that means the Render Elixir docs are wrong:
My apologies, apparently I was wrong. I did a simple test of checking the version in an elixir deployment that we have. You are correct that our docs are wrong. The base image is elixir 1.9.4, and you can set the version with Environment variables. Basically exactly your OP and I stuck my foot right into my mouth. I’ll make an issue to update the docs.