@@ -36,7 +36,6 @@ import type { ReadyRuntimeError } from '../../../../utils/get-error-by-type'
36
36
import { EnvironmentNameLabel } from '../environment-name-label/environment-name-label'
37
37
import { useFocusTrap } from '../dev-tools-indicator/utils'
38
38
import { Fader } from '../../fader'
39
- import { Resizer } from '../../resizer'
40
39
41
40
export interface ErrorOverlayLayoutProps extends ErrorBaseProps {
42
41
errorMessage : ErrorMessageType
@@ -60,7 +59,6 @@ export function ErrorOverlayLayout({
60
59
errorType,
61
60
children,
62
61
errorCode,
63
- errorCount,
64
62
error,
65
63
debugInfo,
66
64
isBuildError,
@@ -85,10 +83,6 @@ export function ErrorOverlayLayout({
85
83
} as React . CSSProperties ,
86
84
}
87
85
88
- const [ animating , setAnimating ] = React . useState (
89
- Boolean ( transitionDurationMs )
90
- )
91
-
92
86
const faderRef = React . useRef < HTMLDivElement | null > ( null )
93
87
const hasFooter = Boolean ( footerMessage || errorCode )
94
88
const dialogRef = React . useRef < HTMLDivElement | null > ( null )
@@ -101,23 +95,9 @@ export function ErrorOverlayLayout({
101
95
}
102
96
}
103
97
104
- function onTransitionEnd ( { propertyName, target } : React . TransitionEvent ) {
105
- // We can only measure height after the `scale` transition ends,
106
- // otherwise we will measure height as a multiple of the animating value
107
- // which will give us an incorrect value.
108
- if ( propertyName === 'scale' && target === dialogRef . current ) {
109
- setAnimating ( false )
110
- }
111
- }
112
-
113
98
return (
114
99
< ErrorOverlayOverlay fixed = { isBuildError } { ...animationProps } >
115
- < div
116
- data-nextjs-dialog-root
117
- onTransitionEnd = { onTransitionEnd }
118
- ref = { dialogRef }
119
- { ...animationProps }
120
- >
100
+ < div data-nextjs-dialog-root ref = { dialogRef } { ...animationProps } >
121
101
< ErrorOverlayNav
122
102
runtimeErrors = { runtimeErrors }
123
103
activeIdx = { activeIdx }
@@ -139,37 +119,30 @@ export function ErrorOverlayLayout({
139
119
)
140
120
}
141
121
>
142
- < Resizer
143
- ref = { dialogResizerRef }
144
- measure = { ! animating }
145
- data-nextjs-dialog-sizer
146
- >
147
- < DialogContent >
148
- < ErrorOverlayDialogHeader >
149
- < div
150
- className = "nextjs__container_errors__error_title"
151
- // allow assertion in tests before error rating is implemented
152
- data-nextjs-error-code = { errorCode }
153
- >
154
- < span data-nextjs-error-label-group >
155
- < ErrorTypeLabel errorType = { errorType } />
156
- { error . environmentName && (
157
- < EnvironmentNameLabel
158
- environmentName = { error . environmentName }
159
- />
160
- ) }
161
- </ span >
162
- < ErrorOverlayToolbar error = { error } debugInfo = { debugInfo } />
163
- </ div >
164
- < ErrorMessage errorMessage = { errorMessage } />
165
- </ ErrorOverlayDialogHeader >
166
-
167
- < ErrorOverlayDialogBody > { children } </ ErrorOverlayDialogBody >
168
- </ DialogContent >
169
- </ Resizer >
122
+ < DialogContent >
123
+ < ErrorOverlayDialogHeader >
124
+ < div
125
+ className = "nextjs__container_errors__error_title"
126
+ // allow assertion in tests before error rating is implemented
127
+ data-nextjs-error-code = { errorCode }
128
+ >
129
+ < span data-nextjs-error-label-group >
130
+ < ErrorTypeLabel errorType = { errorType } />
131
+ { error . environmentName && (
132
+ < EnvironmentNameLabel
133
+ environmentName = { error . environmentName }
134
+ />
135
+ ) }
136
+ </ span >
137
+ < ErrorOverlayToolbar error = { error } debugInfo = { debugInfo } />
138
+ </ div >
139
+ < ErrorMessage errorMessage = { errorMessage } />
140
+ </ ErrorOverlayDialogHeader >
170
141
142
+ < ErrorOverlayDialogBody > { children } </ ErrorOverlayDialogBody >
143
+ </ DialogContent >
171
144
< ErrorOverlayBottomStack
172
- errorCount = { errorCount }
145
+ errorCount = { runtimeErrors ?. length ?? 0 }
173
146
activeIdx = { activeIdx ?? 0 }
174
147
/>
175
148
</ ErrorOverlayDialog >
0 commit comments