Error in LayoutComponent breaks at the wrong location.
See original GitHub issueIf you have an error in the properties of a layout component, the error appears at the parent razor page include line instead of the actual error location.
Example:
Index.razor (this is where the error breaks at):
<MyProject.PrintMessage ParameterMessage="@Message"/>
PrintMessage.razor (where the real error is):
public static string LowercaseMessage = "";
// route the given parameters to static, this is because our JSInvokables are static.
public static string Message = "";
[Parameter]
public string ParameterMessage
{
get
{
return Message;
}
set
{
LowercaseMessage = Message.ToLower(); // <--------- this is the real error here since Message is undefined.
Message = value;
}
}
... razor code ..
[JSInvokable]
public static string OnMouseClickPrintMessage()
{
string message = LowercaseMessage;
// do something with message
}
`
This is the error when you try to load the <MyProject.PrintMessage ParameterMessage=“@Message”/> razor snippet.
Notice that this error is appearing at this.StateHasChanged() and not at “PrintMessage.razor”
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Page layout broken in React Router v6
I tried to follow the docs but now the layout component is placed above all the pages it should be wrapping, not just...
Read more >[Next 13] Server Component + Layout.tsx - Can't access the ...
Verify canary release I verified that the issue exists in the latest Next.js canary release Provide environment information Operating ...
Read more >Force Immediate Layout Update
Anytime you change a RectTransform (or any UI element that needs its quads redrawn) it ... type-of-layout-group-error/58056555#58056555>.
Read more >Solving Common Layout Problems (The Java™ Tutorials > ...
This Swing Java Tutorial describes developing graphical user interfaces (GUIs) for applications and applets using Swing components.
Read more >Resolve common errors for Dashboard Components
This error can happen even if you can see fewer than 20 components on your dashboard. Examples: When you change the Dashboard Layout...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for contacting us, @Bambofy. We’ll look into this post 3.1 timeframe and will get back to you then.
I just gave this a go on VS 16.6 Preview and the exception breaks at the
LowercaseMessage = Message.ToLower();
line so it looks like this issue is resolved now.