imnik11
** (BadMapError) expected a map, got: ..... (stdlib 3.15.2) :maps.keys({
I am new to elixir and struct with this problem.
(BadMapError) expected a map, got: {<<0, 0, 29, 150, 125, 113, 178, 225, 53, 200, 66, 6, 221, 209, 8, 181, 146, 90,
(stdlib 3.15.2) :maps.keys({<<0, 0, 29, 150, 125, 113, 178, 225, 53, 200, 66, 6, 221, 209, 8, 181, 146, 90,
and I think this maybe due to some version difference
In the .ex file I am calling to Map.keys() this way
auth_keys
|> Enum.at(secret_index)
|> Map.keys()
Marked As Solved
imnik11
Resovled it was due to database issues
make clean
and it was solved
Also Liked
Qqwy
It seems like when you copied the keys from the documentation example, you might have missed the starting %, i.e. instead of %{.......} you copied {.......}.
dimitarvp
Can you show us the value of auth_keys and secret_index?
Qqwy
Can you change your snippet
def list_authorized_public_keys_at(%__MODULE__{authorized_keys: auth_keys}, secret_index)
when is_integer(secret_index) and secret_index >= 0 do
auth_keys
|> Enum.at(secret_index)
|> Map.keys()
end
to
def list_authorized_public_keys_at(%__MODULE__{authorized_keys: auth_keys}, secret_index)
when is_integer(secret_index) and secret_index >= 0 do
auth_keys
|> IO.inspect()
|> Enum.at(secret_index)
|> Map.keys()
end
And share the results of the inspection?
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








