Fix uncaught errors from ResizeObserver

This commit is contained in:
Fedor Indutny
2025-06-12 12:18:56 -07:00
committed by GitHub
parent 896a82653d
commit a3187f1527
3 changed files with 8 additions and 20 deletions

View File

@@ -233,6 +233,10 @@
gap: 12px;
}
.NavSidebarSearchHeader .module-SearchInput__container {
flex: 1 0 0;
}
.NavSidebarEmpty {
position: absolute;
top: 0;

View File

@@ -7,7 +7,6 @@
.module-SearchInput {
&__container {
position: relative;
flex: 1 0 0;
margin-inline: 16px;
margin-bottom: 8px;
}

View File

@@ -114,22 +114,7 @@ window.SignalContext.log = {
trace: log.trace,
};
function toLocation(
event: string | Event,
sourceArg?: string,
lineArg?: number,
columnArg?: number
) {
let source = sourceArg;
let line = lineArg;
let column = columnArg;
if (event instanceof ErrorEvent) {
source ??= event.filename;
line ??= event.lineno;
column ??= event.colno;
}
function toLocation(source?: string, line?: number, column?: number) {
if (source == null) {
return '(@ unknown)';
}
@@ -142,11 +127,11 @@ function toLocation(
return `(@ ${source})`;
}
window.onerror = (event, source, line, column, error) => {
window.onerror = (message, source, line, column, error) => {
const errorInfo = Errors.toLogFormat(error);
log.error(
`Top-level unhandled error: ${errorInfo}`,
toLocation(event, source, line, column)
`Top-level unhandled error: ${message}, ${errorInfo}`,
toLocation(source, line, column)
);
};