Closed npalmer-zs closed 1 year ago
The error received in the browser dev console is:
System.AggregateException: One or more errors occurred. (Could not resolve type with token 0100006f from typeref (expected class 'Try.UserComponents.__Main' in assembly 'Try.UserComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'))
---> System.TypeLoadException: Could not resolve type with token 0100006f from typeref (expected class 'Try.UserComponents.__Main' in assembly 'Try.UserComponents, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null')
at TryMudBlazor.Client.Program.Main(String[] args)
--- End of inner exception stack trace ---
On the main website I was having issues where the site was unavailable on multiple devices after triggering this issue in a session, but I am unable to reproduce the issue when running on my local network and don't want to try again on the public site.
Appears that this issue only affects a single session, I'll update the issue description accordingly.
I simplified the snippet to find out what is the core issue:
@typeparam T
<MudText Typo="Typo.h6">Typeparams are not supported!</MudText>
TryMudBlazor does not support typeparams at the moment.
Would you mind if I attempted to add a check for type params with a user facing notification in a pull request?
that would be awesome, thank you!
I guess the restriction only applies to the main component, right?
Yes, the way I encountered the issue was accidentally replacing the main component from code copied out of my IDE instead of a second file I had previously created and was using without any issues.
right. this is also proof: https://try.mudblazor.com/snippet/GuGnkFmLUxSdggSW
by the way, the session un-breaks once the typparam is removed from the main component
Do you think it'd be better to check when initially receiving the stream from the browser, or when going to compile to assembly?
Not sure what is the best approach. Here are a few ideas:
I am sure you'll find out what is best
There is already some pre-compile validation being done on the front-end that I was able to tack another check onto. Created pull request https://github.com/MudBlazor/TryMudBlazor/pull/104
When the following snippet is pasted into the initial razor file, the session crashes. Restarting the application resolves the issue, clearing browser cache & data resolves the issue.