Elixir-ls crashes while formatting code

lsp crashed with the following message in the log.

2024-05-18T07:16:38+05:30 [WARN] Generic lsp request to ElixirLS failed: an exception was raised:
    ** (UndefinedFunctionError) function ElixirSense.Providers.Suggestion.GenericReducer.reduce/6 is undefined (module ElixirSense.Providers.Suggestion.GenericReducer is not available)

It had started with the following info:

Language server with id 2 sent unhandled notification window/logMessage:
{
  "message": "Started ElixirLS v0.21.1",
  "type": 3
}
2024-05-18T07:14:59+05:30 [INFO] Language server with id 2 sent unhandled notification window/logMessage:
{
  "message": "ElixirLS built with elixir \"1.16.2\" on OTP \"26\"",
  "type": 3
}

Where should I look for a solution?