You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I just ran into an unexpected compilation error while updating to the latest version:
error: undefined function to_form/5 (expected MyAppWeb.LiveComponents.QuestionForm to define such a function or for it to be imported, but none are available)
│
37 │ to_form(@form.source, @form, :config, input_value(@form, :type), []) do
│ ^^^^^^^
│
└─ lib/mo_app_web/live/live_components/question_form.ex:37:20: MyAppWeb.LiveComponents.QuestionForm.render/1
From the docs it seems that between v3.0.7 and v4.0.0 (specifically, in commit 7fc853b) the type argument was dropped, which isn't documented in the changelog. Not a huge deal as that commit also adds a new polymorphic_type option, so changing the call as follows got it compiling again:
However, since both the breaking change and the options for to_form/4 are undocumented, it took some rummaging around in the repo to figure out. Maybe it'd be good to mention it in the changelog so no one else gets stumped by it like I did?
(Glad to see this project is still active btw!)
The text was updated successfully, but these errors were encountered:
Sorry, I didn't realise they were intended for internal use only!
I'm using a virtual field of the parent to set the embed type via a select, and the new polymorphic_embed_inputs_for component in the example you linked doesn't seem to have a type attribute that would let me use it in the same way. Using PolymorphicEmbed.HTML.Form.polymorphic_embed_inputs_for/4 as below seems to work just fine though:
However, to_form is also available from the Form module. Maybe the docs could state which functions are meant to be for internal use only? Either way, thanks for the help!
Hi, I just ran into an unexpected compilation error while updating to the latest version:
From the docs it seems that between v3.0.7 and v4.0.0 (specifically, in commit 7fc853b) the
type
argument was dropped, which isn't documented in the changelog. Not a huge deal as that commit also adds a newpolymorphic_type
option, so changing the call as follows got it compiling again:However, since both the breaking change and the options for
to_form/4
are undocumented, it took some rummaging around in the repo to figure out. Maybe it'd be good to mention it in the changelog so no one else gets stumped by it like I did?(Glad to see this project is still active btw!)
The text was updated successfully, but these errors were encountered: