Buckets:
silverwolf-x/project / packages /next /src /next-devtools /dev-overlay /container /runtime-error /index.tsx
| import { useMemo } from 'react' | |
| import { CodeFrame } from '../../components/code-frame/code-frame' | |
| import { ErrorOverlayCallStack } from '../../components/errors/error-overlay-call-stack/error-overlay-call-stack' | |
| import { PSEUDO_HTML_DIFF_STYLES } from './component-stack-pseudo-html' | |
| import { ErrorCause, styles as errorCauseStyles } from './error-cause' | |
| import { | |
| ErrorAggregateErrors, | |
| styles as errorAggregateErrorsStyles, | |
| } from './error-aggregate-errors' | |
| import { | |
| useFrames, | |
| type ReadyRuntimeError, | |
| } from '../../utils/get-error-by-type' | |
| type RuntimeErrorProps = { | |
| error: ReadyRuntimeError | |
| dialogResizerRef: React.RefObject<HTMLDivElement | null> | |
| } | |
| export function RuntimeError({ error, dialogResizerRef }: RuntimeErrorProps) { | |
| const frames = useFrames(error) | |
| const firstFrame = useMemo(() => { | |
| const firstFirstPartyFrameIndex = frames.findIndex( | |
| (entry) => | |
| !entry.ignored && | |
| Boolean(entry.originalCodeFrame) && | |
| Boolean(entry.originalStackFrame) | |
| ) | |
| return frames[firstFirstPartyFrameIndex] ?? null | |
| }, [frames]) | |
| return ( | |
| <> | |
| {firstFrame && ( | |
| <CodeFrame | |
| stackFrame={firstFrame.originalStackFrame!} | |
| codeFrame={firstFrame.originalCodeFrame!} | |
| /> | |
| )} | |
| {frames.length > 0 && ( | |
| <ErrorOverlayCallStack | |
| dialogResizerRef={dialogResizerRef} | |
| frames={frames} | |
| /> | |
| )} | |
| {error.cause && ( | |
| <ErrorCause cause={error.cause} dialogResizerRef={dialogResizerRef} /> | |
| )} | |
| {'aggregateErrors' in error && error.aggregateErrors !== null && ( | |
| <ErrorAggregateErrors | |
| errors={error.aggregateErrors} | |
| dialogResizerRef={dialogResizerRef} | |
| /> | |
| )} | |
| </> | |
| ) | |
| } | |
| export const styles = ` | |
| ${PSEUDO_HTML_DIFF_STYLES} | |
| ${errorCauseStyles} | |
| ${errorAggregateErrorsStyles} | |
| ` | |
Xet Storage Details
- Size:
- 1.87 kB
- Xet hash:
- 283025f68fc5264f652a47a5e62b694db69c8ca9063fbf81de5a9421f7eafe43
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.