Getting error An unhandled exception has occurred. See browser dev tools for details. Reload 🗙
Solution 1
Actually I had the same problem but the solution is with site.css it's contain some lines you need to add it to your css file
#blazor-error-ui{
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;}
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;}
Solution 2
it's not an exception but by removing or not including the css/site.css
file you removed the styles that hide the error message div.
The #blazor-error-ui
defaults to display: none
so by not including or removing it, you're simply just showing the div.
If you include the #blazor-error-ui
and #blazor-error-ui .dismiss
sections, you should be fine, if you didn't want to include the css/site.css file that was generated with your project. You mentioned you deleted it, here is what mine looks like for a new default project:
@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
a, .btn-link {
color: #0366d6;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.content {
padding-top: 1.1rem;
}
.valid.modified:not([type=checkbox]) {
outline: 1px solid #26b050;
}
.invalid {
outline: 1px solid red;
}
.validation-message {
color: red;
}
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}
Best of luck!
Arun Singh
Updated on June 08, 2022Comments
-
Arun Singh almost 2 years
Hi I am working on Blazor server side and getting "An unhandled exception has occurred. See browser dev tools for details. Reload 🗙" message. i tried to see the console but nothing is there. Attached screen of console.
-
ProgrammerBret over 3 yearsFor me clearing cache worked, as I have been making many minor changes which produced this error
-
ProgrammerBret about 3 yearsAt first clearing cache solved this, but when I added these lines this seems to have fixed it.
-
daddycardona over 2 yearsThank you so much. I did delete this and I also added it back to app.css since I am only using wasm :)