Question Blazor app buttons stop working. Unhandled runtime error after added dark mode switching

Pablo

Well-known member
Joined
Aug 12, 2021
Messages
93
Programming Experience
10+
Hi,

After I succeded in adding light/dark theme switching, following a link @Skydiver gave me, an unhandled (runtime) error appeared and my blazor app stop responding to most buttons, those which perform a task, aparently (like Remove a contact from the list and from the DB). I attach a screenshot of when I press F12 (supposedly it shows the errors (Console), but I don't understand them). First I thought the problem was the SweetAlert2 erasure confirm dialog, but then I saw that other buttons didn't work either. Even the Counter button doesn't work. When I saw the F12 errors first, I could see it said something like "Can't load resource from BootstrapColourModeDemo.styles.css" and it's strange because there is a .cs file and its interface (in Service folder) with that name for the dark theme switching, so I added that .css file to wwwroot folder and that error went out, but the other ones are still there.

I made a sample of the app replacing the DB handling by hardcoded lists. Actually, on this 2nd version, in addition of the non working buttons, there are one or two more errors, but if you press F5 (Continue), it reaches de contact list page and you can see the data in the table list. I attach the 2nd version (data hardcoeded) error (runtime errors) screenshot. Finally, I give you the link to the project in a .zip, its size is 3.25MB and the forum says it's too large to attach (nuget packages off so it's lighter, and the data hardcoded), in case someone can help me I will be very grateful. Thank you!

Best Regards
Pablo

 

Attachments

  • forum.png
    forum.png
    37.1 KB · Views: 3
  • forum 2.png
    forum 2.png
    42.7 KB · Views: 2
Back
Top Bottom