Open Jinjinov opened 1 year ago
I can only assume that AOT is somehow stripping or changing the Value
on SelectItem
. It's just a guess. Since we don't have a mac to test the code it would be hard to confirm.
I replaced <Select>
and <SelectItem>
with <select>
and <option>
and now it works.
In <select>
I used value
instead of SelectedValue
and @onchange
instead of SelectedValueChanged
In <option>
I used value
instead of Value
Everything else is the same.
I am trying to understand the error:
Attempting to JIT compile method
'(wrapper delegate-invoke) void <Module>:invoke_callvirt_void_SelectItem`1<DataFormat>_DataFormat (Blazorise.SelectItem`1<Ididit.Backup.DataFormat>,Ididit.Backup.DataFormat)'
while running in aot-only mode.
So, there is:
Why would native html controls work?
Do they use a method with an object
parameter instead of a generic parameter?
Looking at the Blazorise code, this seems like one possibility for this error:
public partial class SelectItem<TValue> : BaseComponent, ISelectItem<TValue>, IDisposable
The constructor with a generic parameter is one obvious difference between <Select>
/ <SelectItem>
and <select>
/ <option>
Do you have TValue
defined on both Select and SelectItem?
No, only on <Select>
Can you try matching TValue on both?
I tried matching TValue
on both, but I still got the same exception.
Not easy to tell from that stack trace but we have a similar issue open. Where a release built application trimming is having a similar behaviour because of a virtual Parameter. This might be the same, there's this one :
[CascadingParameter] protected virtual Select
Describe the bug
This is not exactly a Blazorise bug, but I don't know who to ask for help. You can delete this issue if it doesn't belong here.
Blazorise works great in Blazor WASM, with Photino on Linux, with Maui on Windows and Android and iOS.
On macOS it works great with Maui in Debug, but in Release (published with AOT) it throws this exception:
Do you have any idea what the problem could be?
Is there anything I could do to fix this?
To Reproduce Steps to reproduce the behavior:
<Select>
control