gordoneliel

gordoneliel

Ash Embedded + Custom types error: UnknownError{error: "** (ArgumentError)

Whenever I try to use a custom type like ex_money or a custom type I create, ash does not seem to be able to load an embedded resource. Not sure if I’m missing some config with embedded resources or this is a bug.

Here is an example error with a volume type:

%Ash.Error.Unknown{
errors: [
%Ash.Error.Unknown.UnknownError{error: "** (ArgumentError) cannot load `[%{\"autogenerated_id\" => \"0f887d5a-d861-49c5-ac39-9a33ec5b732c\", \"from_volume\" => [\"cu_ft\", 0], \"price\" => [\"USD\", \"1\"], \"to_volume\" => [\"cu_ft\", 10]}]` as type {:array, #EmbeddedResource.EctoType<[]>
} 

First Post!

gordoneliel

gordoneliel

Weirdly I have to implement Jason.Encoder for tuples for it to even get to this error. I figured it has something to do with the Ash type, since I’m able to use these custom types in non Ash projects.

%Ash.Error.Unknown{
errors: [%Ash.Error.Unknown.UnknownError{
error: "** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for {\"cu_ft\", 0} of type Tuple, Jason.Encoder protocol must always be explicitly implemented. This protocol is implemented for the following type(s): Any, Ash.CiString, Ash.Union, Atom, BitString, Cldr.LanguageTag, Date, DateTime, Decimal, Ecto.Association.NotLoaded, Ecto.Schema.Metadata, ...

Last Post!

gordoneliel

gordoneliel

Submitted! Here is the link to the issue for reference

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement