Problem when refreshing certain pages

Hello @Team,

There has been some problems when refreshing this "panel-list" page in my app. If the page is accessed from another page, everything works normally:


However, after refreshing the page the DataGrid disappears completely:

Another weird thing is that if I click the create button on top right, this happens:

Not only does the DataGrid appears out of nowhere, but the dialog is loaded with an item. It's like the row select event is triggered and the grid is hidden inside the button or something.

We are not aware of such problem. What happens when you attach a debugger?

Using the debugger, this is the usual working output when accessing the page from another page:

info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1]
      Authorization was successful.
Microsoft.AspNetCore.Authorization.DefaultAuthorizationService: Information: Authorization was successful.

And this is the output after refreshing the page:

info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/favicon.ico'. Physical path: 'C:\Files\Repositories\SolidAccessWeb\Code\Front\server\wwwroot\favicon.ico'
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware: Information: Sending file. Request path: '/favicon.ico'. Physical path: 'C:\Files\Repositories\SolidAccessWeb\Code\Front\server\wwwroot\favicon.ico'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 8.8501ms 200 image/x-icon
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 8.8501ms 200 image/x-icon
info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1]
      Authorization was successful.
Microsoft.AspNetCore.Authorization.DefaultAuthorizationService: Information: Authorization was successful.
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://127.0.0.1:5002/assets/images/SF_Hori_White.svg  
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://127.0.0.1:5002/assets/images/SF_Hori_White.svg  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://127.0.0.1:5002/assets/images/SI_White.svg  
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://127.0.0.1:5002/assets/images/SI_White.svg  
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /assets/images/SF_Hori_White.svg was not modified
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware: Information: The file /assets/images/SF_Hori_White.svg was not modified
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware: Information: The file /assets/images/SI_White.svg was not modified
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /assets/images/SI_White.svg was not modified
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 9.0329ms 304 image/svg+xml
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 9.0329ms 304 image/svg+xml
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 11.7947ms 304 image/svg+xml
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 11.7947ms 304 image/svg+xml
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request starting HTTP/1.1 GET http://127.0.0.1:5002/assets/fonts/MaterialIcons-Regular.woff  
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://127.0.0.1:5002/assets/fonts/MaterialIcons-Regular.woff  
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[6]
      The file /assets/fonts/MaterialIcons-Regular.woff was not modified
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware: Information: The file /assets/fonts/MaterialIcons-Regular.woff was not modified
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 6.9428ms 304 application/font-woff
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished in 6.9428ms 304 application/font-woff

I noticed that in the middle of the refreshing process, an error log quickly appears in the console and disappears right before the new page loads. The log contains this message:

Error: Blazor Circuit has been shut down due to error

Another observation is that sometimes the page refreshes as it should, but that's roughly 20% of the time.

The log is perfectly normal - it shows the StaticFileMiddleware returning static files - fonts, images and icons. The Circuit has been shut down due to error is suspicious though. Something is throwing an exception. Can't tell what though. You can try commenting out components in that page (or setting their Visible property to false) to find which the problematic one is.

UPDATE: Forgot about this one - try configuring your debugger to break on all exceptions. It may at least point out to something closer to the real culprit.

It seems there's a way to preserve console logs, so here it is in full:

I commented out the entire page and the error still happens:


There was no way of throwing the error when debugging in Visual Studio and breaking on all exceptions. Nothing happened.

Then it is probably something coming from the layout. Try removing <RadzenNotification />, <RadenDialog/>, <RadzenPanelMenu />. I suspect it could be some of the ones that use a service - dialog, notification, context menu.

UPDATE: forgot to mention the tooltip - try commenting <RadzenToolTip /> from the layout too.

OK, so after lots of commenting and testing:

  • Removing all the components in the layout fixed the error.
  • Having any Radzen component in the layout will cause this bug. And I mean any, from the RadzenTooltip to the RadzenLabel to the RadzenBody, etc. With raw HTML components, it will work every single time.

I'll be happy to ship my app to you for further investigation. There is a database safe version that I can send it right now.

You can send it to info@radzen.com. However we have a 20-ish MB attachment limit so make sure to delete any bin and obj directories from your project.

I've zipped the app (~4mb total) and sent it.
UPDATE: .zip was rejected, should work with .7z format.

Got it. Do we just need to refresh the browser to reproduce the problem (CTRL+F5)?

Yes, CTRL+F5 it is. Just make sure to try a couple of times, it might not happen at first glance.

What should I do with the database? I created an empty MySQL database however I cannot get past the following exception:

MySql.Data.MySqlClient.MySqlException (0x80004005): Table 'falcon.user' doesn't exist

Are there any migrations or SQL script?

Remove the MySQL database entirely, then try running the following commands in the Global project terminal:

dotnet ef migrations add Initial
dotnet ef database update

This should migrate the database correctly, if the Database project isn't already doing so.

OK. How do I get pass the login screen? Couldn't reproduce the error there.

I sent over with the details in the email. Use "admin" for username and "admin" for password.

Try with the panel-list page.

Logging with admin/admin redirects me back to the login screen.

Running the Database project should create your default admin/admin user.

I have done that and there is a record created in the user table. It accepts admin/admin goes to some page and then redirects me back to the login.