Jose v1.11.9 Compatibility Issue with elixir v1.11.4

When I try to run mix deps.compile , i am getting the below error
==> jose
warning: the dependency :jose requires Elixir “~> 1.13” but you are running on v1.11.4
Compiling 112 files (.erl)
src/jose_server.erl:137: syntax error before: ‘catch’
src/jose_server.erl:32: function handle_call/3 undefined
could not compile dependency :jose, “mix compile” failed. You can recompile this dependency with “mix deps.compile jose”, update it with “mix deps.update jose” or clean it with “mix deps.clean jose”

1 Like

Yes, you’ll need to upgrade your Elixir version. BTW, Elixir current version is 1.16 so 1.11 is really quite old so updating is good advice no matter what.

We have some dependencies which are compatible with 1.11.4 elixir version, so can u suggest some other solution?
I have observed that the project uses pheonix dependency, which internally use joken 2.2 version and joken internally uses jose 1.11.9, the latest version which is causing this issue.
the mix.lock file generated 2 days back was using 1.11.6 jose version and it was working, but today when i tried running the project it is internally using 1.11.9 and causing this issue

I don’t think there is a magic solution here. Sounds like you’ll need to roll back to Jose version 1.11.6. Try targeting {:jose, "1.11.6", override: true} and see if that works. It very well may not work.

Have tried it and it didn’t work. Its still taking jose 1.11.9 version itself

After putting the override clause, try running:

mix deps.clean --unlock --unused
mix deps.get

The issue was resolved by specifying {:jose, "1.11.6", override: true}, in mix.exs file of the project.

1 Like

You previously said that this doesn’t work, what made it work now?

I had downgraded some other dependencies which were related to Jose as well so it didn’t work, but when I downgraded Jose dependency it worked

Reiterating what others have said though, I would definitely prioritize a generalized dependency and Elixir upgrade at this point.

3 Likes