next 15.2.0-canary.50 → 15.2.0-canary.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/load-jsconfig.d.ts +1 -0
- package/dist/build/load-jsconfig.js +2 -1
- package/dist/build/load-jsconfig.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.d.ts +3 -1
- package/dist/build/webpack-config.js +44 -23
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/components/errors/attach-hydration-error-state.js +37 -24
- package/dist/client/components/errors/attach-hydration-error-state.js.map +1 -1
- package/dist/client/components/errors/hydration-error-info.js +86 -19
- package/dist/client/components/errors/hydration-error-info.js.map +1 -1
- package/dist/client/components/is-hydration-error.d.ts +1 -0
- package/dist/client/components/is-hydration-error.js +41 -3
- package/dist/client/components/is-hydration-error.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js +1 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.d.ts +1 -56
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +4 -240
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.stories.js +0 -21
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.d.ts +54 -0
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js +101 -0
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -0
- package/dist/client/components/react-dev-overlay/internal/container/Errors.js +1 -2
- package/dist/client/components/react-dev-overlay/internal/container/Errors.js.map +1 -1
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.d.ts +2 -56
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.js +28 -227
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.js.map +1 -1
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/index.js +1 -1
- package/dist/client/components/react-dev-overlay/internal/container/RuntimeError/index.js.map +1 -1
- package/dist/client/components/react-dev-overlay/internal/styles/ComponentStyles.js +3 -1
- package/dist/client/components/react-dev-overlay/internal/styles/ComponentStyles.js.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +6 -6
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/load-jsconfig.js +2 -1
- package/dist/esm/build/load-jsconfig.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +44 -23
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/components/errors/attach-hydration-error-state.js +38 -25
- package/dist/esm/client/components/errors/attach-hydration-error-state.js.map +1 -1
- package/dist/esm/client/components/errors/hydration-error-info.js +87 -20
- package/dist/esm/client/components/errors/hydration-error-info.js.map +1 -1
- package/dist/esm/client/components/is-hydration-error.js +36 -2
- package/dist/esm/client/components/is-hydration-error.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js +1 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +3 -287
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.stories.js +0 -21
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js +132 -0
- package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/internal/container/Errors.js +1 -2
- package/dist/esm/client/components/react-dev-overlay/internal/container/Errors.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.js +12 -271
- package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/index.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/index.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/internal/styles/ComponentStyles.js +3 -1
- package/dist/esm/client/components/react-dev-overlay/internal/styles/ComponentStyles.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/lib/metadata/metadata.js +2 -2
- package/dist/esm/lib/metadata/metadata.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/lib/metadata/metadata.js +2 -2
- package/dist/lib/metadata/metadata.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/internal/container/Errors.tsx"],"sourcesContent":["import { useState, useEffect, useMemo, useCallback, Suspense } from 'react'\nimport {\n ACTION_UNHANDLED_ERROR,\n ACTION_UNHANDLED_REJECTION,\n type UnhandledErrorAction,\n type UnhandledRejectionAction,\n} from '../../shared'\nimport type { DebugInfo } from '../../types'\nimport {\n Dialog,\n DialogBody,\n DialogContent,\n DialogHeader,\n} from '../components/Dialog'\nimport { LeftRightDialogHeader } from '../components/LeftRightDialogHeader'\nimport { Overlay } from '../components/Overlay'\nimport { Toast } from '../components/Toast'\nimport { getErrorByType } from '../helpers/get-error-by-type'\nimport type { ReadyRuntimeError } from '../helpers/get-error-by-type'\nimport { noop as css } from '../helpers/noop-template'\nimport { CloseIcon } from '../icons/CloseIcon'\nimport { RuntimeError } from './RuntimeError'\nimport { VersionStalenessInfo } from '../components/VersionStalenessInfo'\nimport type { VersionInfo } from '../../../../../server/dev/parse-version-info'\nimport { getErrorSource } from '../../../../../shared/lib/error-source'\nimport { HotlinkedText } from '../components/hot-linked-text'\nimport { PseudoHtmlDiff } from './RuntimeError/component-stack-pseudo-html'\nimport {\n type HydrationErrorState,\n getHydrationWarningType,\n} from '../../../errors/hydration-error-info'\nimport { NodejsInspectorCopyButton } from '../components/nodejs-inspector'\nimport { CopyButton } from '../components/copy-button'\nimport {\n getUnhandledErrorType,\n isUnhandledConsoleOrRejection,\n} from '../../../errors/console-error'\nimport { extractNextErrorCode } from '../../../../../lib/error-telemetry-utils'\n\nexport type SupportedErrorEvent = {\n id: number\n event: UnhandledErrorAction | UnhandledRejectionAction\n}\nexport type ErrorsProps = {\n isAppDir: boolean\n errors: SupportedErrorEvent[]\n initialDisplayState: DisplayState\n versionInfo?: VersionInfo\n hasStaticIndicator?: boolean\n debugInfo?: DebugInfo\n}\n\ntype ReadyErrorEvent = ReadyRuntimeError\n\ntype DisplayState = 'minimized' | 'fullscreen' | 'hidden'\n\nfunction isNextjsLink(text: string): boolean {\n return text.startsWith('https://nextjs.org')\n}\n\nfunction ErrorDescription({\n error,\n hydrationWarning,\n}: {\n error: Error\n hydrationWarning: string | null\n}) {\n const isUnhandledOrReplayError = isUnhandledConsoleOrRejection(error)\n const unhandledErrorType = isUnhandledOrReplayError\n ? getUnhandledErrorType(error)\n : null\n const isConsoleErrorStringMessage = unhandledErrorType === 'string'\n // If the error is:\n // - hydration warning\n // - captured console error or unhandled rejection\n // skip displaying the error name\n const title =\n (isUnhandledOrReplayError && isConsoleErrorStringMessage) ||\n hydrationWarning\n ? ''\n : error.name + ': '\n\n // If it's replayed error, display the environment name\n const environmentName =\n 'environmentName' in error ? error['environmentName'] : ''\n const envPrefix = environmentName ? `[ ${environmentName} ] ` : ''\n return (\n <>\n {envPrefix}\n {title}\n <HotlinkedText\n text={hydrationWarning || error.message}\n matcher={isNextjsLink}\n />\n </>\n )\n}\n\nfunction getErrorSignature(ev: SupportedErrorEvent): string {\n const { event } = ev\n switch (event.type) {\n case ACTION_UNHANDLED_ERROR:\n case ACTION_UNHANDLED_REJECTION: {\n return `${event.reason.name}::${event.reason.message}::${event.reason.stack}`\n }\n default: {\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = event\n return ''\n}\n\nexport function Errors({\n isAppDir,\n errors,\n initialDisplayState,\n versionInfo,\n hasStaticIndicator,\n debugInfo,\n}: ErrorsProps) {\n const [lookups, setLookups] = useState(\n {} as { [eventId: string]: ReadyErrorEvent }\n )\n\n const [readyErrors, nextError] = useMemo<\n [ReadyErrorEvent[], SupportedErrorEvent | null]\n >(() => {\n let ready: ReadyErrorEvent[] = []\n let next: SupportedErrorEvent | null = null\n\n // Ensure errors are displayed in the order they occurred in:\n for (let idx = 0; idx < errors.length; ++idx) {\n const e = errors[idx]\n const { id } = e\n if (id in lookups) {\n ready.push(lookups[id])\n continue\n }\n\n // Check for duplicate errors\n if (idx > 0) {\n const prev = errors[idx - 1]\n if (getErrorSignature(prev) === getErrorSignature(e)) {\n continue\n }\n }\n\n next = e\n break\n }\n\n return [ready, next]\n }, [errors, lookups])\n\n const isLoading = useMemo<boolean>(() => {\n return readyErrors.length < 1 && Boolean(errors.length)\n }, [errors.length, readyErrors.length])\n\n useEffect(() => {\n if (nextError == null) {\n return\n }\n\n let mounted = true\n getErrorByType(nextError, isAppDir).then((resolved) => {\n if (mounted) {\n // We don't care if the desired error changed while we were resolving,\n // thus we're not tracking it using a ref. Once the work has been done,\n // we'll store it.\n setLookups((m) => ({ ...m, [resolved.id]: resolved }))\n }\n })\n\n return () => {\n mounted = false\n }\n }, [nextError, isAppDir])\n\n const [displayState, setDisplayState] =\n useState<DisplayState>(initialDisplayState)\n const [activeIdx, setActiveIndex] = useState<number>(0)\n const previous = useCallback(\n () => setActiveIndex((v) => Math.max(0, v - 1)),\n []\n )\n const next = useCallback(\n () =>\n setActiveIndex((v) =>\n Math.max(0, Math.min(readyErrors.length - 1, v + 1))\n ),\n [readyErrors.length]\n )\n\n const activeError = useMemo<ReadyErrorEvent | null>(\n () => readyErrors[activeIdx] ?? null,\n [activeIdx, readyErrors]\n )\n\n // Reset component state when there are no errors to be displayed.\n // This should never happen, but lets handle it.\n useEffect(() => {\n if (errors.length < 1) {\n setLookups({})\n setDisplayState('hidden')\n setActiveIndex(0)\n }\n }, [errors.length])\n\n const minimize = useCallback(() => setDisplayState('minimized'), [])\n const hide = useCallback(() => setDisplayState('hidden'), [])\n const fullscreen = useCallback(() => setDisplayState('fullscreen'), [])\n\n // This component shouldn't be rendered with no errors, but if it is, let's\n // handle it gracefully by rendering nothing.\n if (errors.length < 1 || activeError == null) {\n return null\n }\n\n if (isLoading) {\n // TODO: better loading state\n return <Overlay />\n }\n\n if (displayState === 'hidden') {\n return null\n }\n\n if (displayState === 'minimized') {\n return (\n <Toast\n data-nextjs-toast\n data-issues\n className={`nextjs-toast-errors-parent${hasStaticIndicator ? ' nextjs-error-with-static' : ''}`}\n onClick={fullscreen}\n >\n <div className=\"nextjs-toast-errors\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"></line>\n <line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"></line>\n </svg>\n <span>\n <span data-issues-count>{readyErrors.length}</span> issue\n {readyErrors.length > 1 ? 's' : ''}\n </span>\n <button\n data-nextjs-toast-errors-hide-button\n className=\"nextjs-toast-hide-button\"\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n hide()\n }}\n aria-label=\"Hide Issues\"\n >\n <CloseIcon />\n </button>\n </div>\n </Toast>\n )\n }\n\n const error = activeError.error\n const isServerError = ['server', 'edge-server'].includes(\n getErrorSource(error) || ''\n )\n const isUnhandledError = isUnhandledConsoleOrRejection(error)\n const errorDetails: HydrationErrorState = (error as any).details || {}\n const notes = errorDetails.notes || ''\n const [warningTemplate, serverContent, clientContent] =\n errorDetails.warning || [null, '', '']\n\n const hydrationErrorType = getHydrationWarningType(warningTemplate)\n const hydrationWarning = warningTemplate\n ? warningTemplate\n .replace('%s', serverContent)\n .replace('%s', clientContent)\n .replace('%s', '') // remove the %s for stack\n .replace(/%s$/, '') // If there's still a %s at the end, remove it\n .replace(/^Warning: /, '')\n .replace(/^Error: /, '')\n : null\n\n return (\n <Overlay>\n <Dialog\n type=\"error\"\n aria-labelledby=\"nextjs__container_errors_label\"\n aria-describedby=\"nextjs__container_errors_desc\"\n onClose={isServerError ? undefined : minimize}\n >\n <DialogContent>\n <DialogHeader className=\"nextjs-container-errors-header\">\n <LeftRightDialogHeader\n previous={activeIdx > 0 ? previous : null}\n next={activeIdx < readyErrors.length - 1 ? next : null}\n close={isServerError ? undefined : minimize}\n >\n <small>\n <span>{activeIdx + 1}</span> of{' '}\n <span data-nextjs-dialog-header-total-count>\n {readyErrors.length}\n </span>\n {' issue'}\n {readyErrors.length < 2 ? '' : 's'}\n </small>\n <VersionStalenessInfo versionInfo={versionInfo} />\n </LeftRightDialogHeader>\n\n <div\n className=\"nextjs__container_errors__error_title\"\n data-nextjs-error-code={extractNextErrorCode(error)} // allow assertion in tests before error rating is implemented\n >\n <h1\n id=\"nextjs__container_errors_label\"\n className=\"nextjs__container_errors_label\"\n >\n {isServerError\n ? 'Server Error'\n : isUnhandledError\n ? 'Console Error'\n : 'Unhandled Runtime Error'}\n </h1>\n <span>\n <CopyButton\n data-nextjs-data-runtime-error-copy-stack\n actionLabel=\"Copy error stack\"\n successLabel=\"Copied\"\n content={error.stack || ''}\n disabled={!error.stack}\n />\n\n <NodejsInspectorCopyButton\n devtoolsFrontendUrl={debugInfo?.devtoolsFrontendUrl}\n />\n </span>\n </div>\n <p\n id=\"nextjs__container_errors_desc\"\n className=\"nextjs__container_errors_desc\"\n >\n <ErrorDescription\n error={error}\n hydrationWarning={hydrationWarning}\n />\n </p>\n {notes ? (\n <>\n <p\n id=\"nextjs__container_errors__notes\"\n className=\"nextjs__container_errors__notes\"\n >\n {notes}\n </p>\n </>\n ) : null}\n {hydrationWarning ? (\n <p\n id=\"nextjs__container_errors__link\"\n className=\"nextjs__container_errors__link\"\n >\n <HotlinkedText text=\"See more info here: https://nextjs.org/docs/messages/react-hydration-error\" />\n </p>\n ) : null}\n\n {hydrationWarning &&\n (activeError.componentStackFrames?.length ||\n !!errorDetails.reactOutputComponentDiff) ? (\n <PseudoHtmlDiff\n className=\"nextjs__container_errors__component-stack\"\n hydrationMismatchType={hydrationErrorType}\n componentStackFrames={activeError.componentStackFrames || []}\n firstContent={serverContent}\n secondContent={clientContent}\n reactOutputComponentDiff={errorDetails.reactOutputComponentDiff}\n />\n ) : null}\n {isServerError ? (\n <div>\n <small>\n This error happened while generating the page. Any console\n logs will be displayed in the terminal window.\n </small>\n </div>\n ) : undefined}\n </DialogHeader>\n <Suspense fallback={<div data-nextjs-error-suspended />}>\n <DialogBody className=\"nextjs-container-errors-body\">\n <RuntimeError\n key={activeError.id.toString()}\n error={activeError}\n />\n </DialogBody>\n </Suspense>\n </DialogContent>\n </Dialog>\n </Overlay>\n )\n}\n\nexport const styles = css`\n .nextjs-error-with-static {\n bottom: calc(var(--size-gap-double) * 4.5);\n }\n .nextjs-container-errors-header {\n position: relative;\n }\n .nextjs-container-errors-header > h1 {\n font-size: var(--size-font-big);\n line-height: var(--size-font-bigger);\n font-weight: bold;\n margin: calc(var(--size-gap-double) * 1.5) 0;\n color: var(--color-title-h1);\n }\n .nextjs-container-errors-header small {\n font-size: var(--size-font-small);\n color: var(--color-accents-1);\n margin-left: var(--size-gap-double);\n }\n .nextjs-container-errors-header small > span {\n font-family: var(--font-stack-monospace);\n }\n .nextjs-container-errors-header p {\n font-size: var(--size-font-small);\n line-height: var(--size-font-big);\n white-space: pre-wrap;\n }\n .nextjs__container_errors_desc {\n font-family: var(--font-stack-monospace);\n padding: var(--size-gap) var(--size-gap-double);\n border-left: 2px solid var(--color-text-color-red-1);\n margin-top: var(--size-gap);\n font-weight: bold;\n color: var(--color-text-color-red-1);\n background-color: var(--color-text-background-red-1);\n }\n p.nextjs__container_errors__link {\n margin: var(--size-gap-double) auto;\n color: var(--color-text-color-red-1);\n font-weight: 600;\n font-size: 15px;\n }\n p.nextjs__container_errors__notes {\n margin: var(--size-gap-double) auto;\n color: var(--color-stack-notes);\n font-weight: 600;\n font-size: 15px;\n }\n .nextjs-container-errors-header > div > small {\n margin: 0;\n margin-top: var(--size-gap-half);\n }\n .nextjs-container-errors-header > p > a {\n color: inherit;\n font-weight: bold;\n }\n .nextjs-container-errors-body > h2:not(:first-child) {\n margin-top: calc(var(--size-gap-double) + var(--size-gap));\n }\n .nextjs-container-errors-body > h2 {\n color: var(--color-title-color);\n margin-bottom: var(--size-gap);\n font-size: var(--size-font-big);\n }\n .nextjs__container_errors__component-stack {\n padding: 12px 32px;\n color: var(--color-ansi-fg);\n background: var(--color-ansi-bg);\n }\n .nextjs-toast-errors-parent {\n cursor: pointer;\n transition: transform 0.2s ease;\n }\n .nextjs-toast-errors-parent:hover {\n transform: scale(1.1);\n }\n .nextjs-toast-errors {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n }\n .nextjs-toast-errors > svg {\n margin-right: var(--size-gap);\n }\n .nextjs-toast-hide-button {\n margin-left: var(--size-gap-triple);\n border: none;\n background: none;\n color: var(--color-ansi-bright-white);\n padding: 0;\n transition: opacity 0.25s ease;\n opacity: 0.7;\n }\n .nextjs-toast-hide-button:hover {\n opacity: 1;\n }\n .nextjs-container-errors-header\n > .nextjs-container-build-error-version-status {\n position: absolute;\n top: 0;\n right: 0;\n }\n .nextjs__container_errors_inspect_copy_button {\n cursor: pointer;\n background: none;\n border: none;\n color: var(--color-ansi-bright-white);\n font-size: 1.5rem;\n padding: 0;\n margin: 0;\n margin-left: var(--size-gap);\n transition: opacity 0.25s ease;\n }\n .nextjs__container_errors__error_title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .nextjs-data-runtime-error-inspect-link,\n .nextjs-data-runtime-error-inspect-link:hover {\n margin: 0 8px;\n color: inherit;\n }\n`\n"],"names":["useState","useEffect","useMemo","useCallback","Suspense","ACTION_UNHANDLED_ERROR","ACTION_UNHANDLED_REJECTION","Dialog","DialogBody","DialogContent","DialogHeader","LeftRightDialogHeader","Overlay","Toast","getErrorByType","noop","css","CloseIcon","RuntimeError","VersionStalenessInfo","getErrorSource","HotlinkedText","PseudoHtmlDiff","getHydrationWarningType","NodejsInspectorCopyButton","CopyButton","getUnhandledErrorType","isUnhandledConsoleOrRejection","extractNextErrorCode","isNextjsLink","text","startsWith","ErrorDescription","error","hydrationWarning","isUnhandledOrReplayError","unhandledErrorType","isConsoleErrorStringMessage","title","name","environmentName","envPrefix","message","matcher","getErrorSignature","ev","event","type","reason","stack","_","Errors","isAppDir","errors","initialDisplayState","versionInfo","hasStaticIndicator","debugInfo","activeError","lookups","setLookups","readyErrors","nextError","ready","next","idx","length","e","id","push","prev","isLoading","Boolean","mounted","then","resolved","m","displayState","setDisplayState","activeIdx","setActiveIndex","previous","v","Math","max","min","minimize","hide","fullscreen","data-nextjs-toast","data-issues","className","onClick","div","svg","xmlns","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","circle","cx","cy","r","line","x1","y1","x2","y2","span","data-issues-count","button","data-nextjs-toast-errors-hide-button","stopPropagation","aria-label","isServerError","includes","isUnhandledError","errorDetails","details","notes","warningTemplate","serverContent","clientContent","warning","hydrationErrorType","replace","aria-labelledby","aria-describedby","onClose","undefined","close","small","data-nextjs-dialog-header-total-count","data-nextjs-error-code","h1","data-nextjs-data-runtime-error-copy-stack","actionLabel","successLabel","content","disabled","devtoolsFrontendUrl","p","componentStackFrames","reactOutputComponentDiff","hydrationMismatchType","firstContent","secondContent","fallback","data-nextjs-error-suspended","toString","styles"],"mappings":";;;;;;;;;;;AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,QAAO;AAC3E,SACEC,sBAAsB,EACtBC,0BAA0B,QAGrB,eAAc;AAErB,SACEC,MAAM,EACNC,UAAU,EACVC,aAAa,EACbC,YAAY,QACP,uBAAsB;AAC7B,SAASC,qBAAqB,QAAQ,sCAAqC;AAC3E,SAASC,OAAO,QAAQ,wBAAuB;AAC/C,SAASC,KAAK,QAAQ,sBAAqB;AAC3C,SAASC,cAAc,QAAQ,+BAA8B;AAE7D,SAASC,QAAQC,GAAG,QAAQ,2BAA0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8CAETiC;;iCAGH;4BACH1F,iCACC,KAACgH;gCACC9E,IAAG;gCACHuB,WAAU;0CAEV,cAAA,KAACtE;oCAAcS,MAAK;;iCAEpB;4BAEHI,oBACAwB,CAAAA,EAAAA,oCAAAA,YAAYyF,oBAAoB,qBAAhCzF,kCAAkCQ,MAAM,KACvC,CAAC,CAACwD,aAAa0B,wBAAwB,AAAD,kBACtC,KAAC9H;gCACCqE,WAAU;gCACV0D,uBAAuBpB;gCACvBkB,sBAAsBzF,YAAYyF,oBAAoB,IAAI,EAAE;gCAC5DG,cAAcxB;gCACdyB,eAAexB;gCACfqB,0BAA0B1B,aAAa0B,wBAAwB;iCAE/D;4BACH7B,8BACC,KAAC1B;0CACC,cAAA,KAAC2C;8CAAM;;iCAKPF;;;kCAEN,KAAClI;wBAASoJ,wBAAU,KAAC3D;4BAAI4D,6BAA2B;;kCAClD,cAAA,KAACjJ;4BAAWmF,WAAU;sCACpB,cAAA,KAACzE;gCAECe,OAAOyB;+BADFA,YAAYU,EAAE,CAACsF,QAAQ;;;;;;;AAS5C;AAEA,OAAO,MAAMC,SAAS3I,uBA2HrB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/internal/container/Errors.tsx"],"sourcesContent":["import { useState, useEffect, useMemo, useCallback, Suspense } from 'react'\nimport {\n ACTION_UNHANDLED_ERROR,\n ACTION_UNHANDLED_REJECTION,\n type UnhandledErrorAction,\n type UnhandledRejectionAction,\n} from '../../shared'\nimport type { DebugInfo } from '../../types'\nimport {\n Dialog,\n DialogBody,\n DialogContent,\n DialogHeader,\n} from '../components/Dialog'\nimport { LeftRightDialogHeader } from '../components/LeftRightDialogHeader'\nimport { Overlay } from '../components/Overlay'\nimport { Toast } from '../components/Toast'\nimport { getErrorByType } from '../helpers/get-error-by-type'\nimport type { ReadyRuntimeError } from '../helpers/get-error-by-type'\nimport { noop as css } from '../helpers/noop-template'\nimport { CloseIcon } from '../icons/CloseIcon'\nimport { RuntimeError } from './RuntimeError'\nimport { VersionStalenessInfo } from '../components/VersionStalenessInfo'\nimport type { VersionInfo } from '../../../../../server/dev/parse-version-info'\nimport { getErrorSource } from '../../../../../shared/lib/error-source'\nimport { HotlinkedText } from '../components/hot-linked-text'\nimport { PseudoHtmlDiff } from './RuntimeError/component-stack-pseudo-html'\nimport {\n type HydrationErrorState,\n getHydrationWarningType,\n} from '../../../errors/hydration-error-info'\nimport { NodejsInspectorCopyButton } from '../components/nodejs-inspector'\nimport { CopyButton } from '../components/copy-button'\nimport {\n getUnhandledErrorType,\n isUnhandledConsoleOrRejection,\n} from '../../../errors/console-error'\nimport { extractNextErrorCode } from '../../../../../lib/error-telemetry-utils'\n\nexport type SupportedErrorEvent = {\n id: number\n event: UnhandledErrorAction | UnhandledRejectionAction\n}\nexport type ErrorsProps = {\n isAppDir: boolean\n errors: SupportedErrorEvent[]\n initialDisplayState: DisplayState\n versionInfo?: VersionInfo\n hasStaticIndicator?: boolean\n debugInfo?: DebugInfo\n}\n\ntype ReadyErrorEvent = ReadyRuntimeError\n\ntype DisplayState = 'minimized' | 'fullscreen' | 'hidden'\n\nfunction isNextjsLink(text: string): boolean {\n return text.startsWith('https://nextjs.org')\n}\n\nfunction ErrorDescription({\n error,\n hydrationWarning,\n}: {\n error: Error\n hydrationWarning: string | null\n}) {\n const isUnhandledOrReplayError = isUnhandledConsoleOrRejection(error)\n const unhandledErrorType = isUnhandledOrReplayError\n ? getUnhandledErrorType(error)\n : null\n const isConsoleErrorStringMessage = unhandledErrorType === 'string'\n // If the error is:\n // - hydration warning\n // - captured console error or unhandled rejection\n // skip displaying the error name\n const title =\n (isUnhandledOrReplayError && isConsoleErrorStringMessage) ||\n hydrationWarning\n ? ''\n : error.name + ': '\n\n // If it's replayed error, display the environment name\n const environmentName =\n 'environmentName' in error ? error['environmentName'] : ''\n const envPrefix = environmentName ? `[ ${environmentName} ] ` : ''\n return (\n <>\n {envPrefix}\n {title}\n <HotlinkedText\n text={hydrationWarning || error.message}\n matcher={isNextjsLink}\n />\n </>\n )\n}\n\nfunction getErrorSignature(ev: SupportedErrorEvent): string {\n const { event } = ev\n switch (event.type) {\n case ACTION_UNHANDLED_ERROR:\n case ACTION_UNHANDLED_REJECTION: {\n return `${event.reason.name}::${event.reason.message}::${event.reason.stack}`\n }\n default: {\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = event\n return ''\n}\n\nexport function Errors({\n isAppDir,\n errors,\n initialDisplayState,\n versionInfo,\n hasStaticIndicator,\n debugInfo,\n}: ErrorsProps) {\n const [lookups, setLookups] = useState(\n {} as { [eventId: string]: ReadyErrorEvent }\n )\n\n const [readyErrors, nextError] = useMemo<\n [ReadyErrorEvent[], SupportedErrorEvent | null]\n >(() => {\n let ready: ReadyErrorEvent[] = []\n let next: SupportedErrorEvent | null = null\n\n // Ensure errors are displayed in the order they occurred in:\n for (let idx = 0; idx < errors.length; ++idx) {\n const e = errors[idx]\n const { id } = e\n if (id in lookups) {\n ready.push(lookups[id])\n continue\n }\n\n // Check for duplicate errors\n if (idx > 0) {\n const prev = errors[idx - 1]\n if (getErrorSignature(prev) === getErrorSignature(e)) {\n continue\n }\n }\n\n next = e\n break\n }\n\n return [ready, next]\n }, [errors, lookups])\n\n const isLoading = useMemo<boolean>(() => {\n return readyErrors.length < 1 && Boolean(errors.length)\n }, [errors.length, readyErrors.length])\n\n useEffect(() => {\n if (nextError == null) {\n return\n }\n\n let mounted = true\n getErrorByType(nextError, isAppDir).then((resolved) => {\n if (mounted) {\n // We don't care if the desired error changed while we were resolving,\n // thus we're not tracking it using a ref. Once the work has been done,\n // we'll store it.\n setLookups((m) => ({ ...m, [resolved.id]: resolved }))\n }\n })\n\n return () => {\n mounted = false\n }\n }, [nextError, isAppDir])\n\n const [displayState, setDisplayState] =\n useState<DisplayState>(initialDisplayState)\n const [activeIdx, setActiveIndex] = useState<number>(0)\n const previous = useCallback(\n () => setActiveIndex((v) => Math.max(0, v - 1)),\n []\n )\n const next = useCallback(\n () =>\n setActiveIndex((v) =>\n Math.max(0, Math.min(readyErrors.length - 1, v + 1))\n ),\n [readyErrors.length]\n )\n\n const activeError = useMemo<ReadyErrorEvent | null>(\n () => readyErrors[activeIdx] ?? null,\n [activeIdx, readyErrors]\n )\n\n // Reset component state when there are no errors to be displayed.\n // This should never happen, but lets handle it.\n useEffect(() => {\n if (errors.length < 1) {\n setLookups({})\n setDisplayState('hidden')\n setActiveIndex(0)\n }\n }, [errors.length])\n\n const minimize = useCallback(() => setDisplayState('minimized'), [])\n const hide = useCallback(() => setDisplayState('hidden'), [])\n const fullscreen = useCallback(() => setDisplayState('fullscreen'), [])\n\n // This component shouldn't be rendered with no errors, but if it is, let's\n // handle it gracefully by rendering nothing.\n if (errors.length < 1 || activeError == null) {\n return null\n }\n\n if (isLoading) {\n // TODO: better loading state\n return <Overlay />\n }\n\n if (displayState === 'hidden') {\n return null\n }\n\n if (displayState === 'minimized') {\n return (\n <Toast\n data-nextjs-toast\n data-issues\n className={`nextjs-toast-errors-parent${hasStaticIndicator ? ' nextjs-error-with-static' : ''}`}\n onClick={fullscreen}\n >\n <div className=\"nextjs-toast-errors\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"></line>\n <line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"></line>\n </svg>\n <span>\n <span data-issues-count>{readyErrors.length}</span> issue\n {readyErrors.length > 1 ? 's' : ''}\n </span>\n <button\n data-nextjs-toast-errors-hide-button\n className=\"nextjs-toast-hide-button\"\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n hide()\n }}\n aria-label=\"Hide Issues\"\n >\n <CloseIcon />\n </button>\n </div>\n </Toast>\n )\n }\n\n const error = activeError.error\n const isServerError = ['server', 'edge-server'].includes(\n getErrorSource(error) || ''\n )\n const isUnhandledError = isUnhandledConsoleOrRejection(error)\n const errorDetails: HydrationErrorState = (error as any).details || {}\n const notes = errorDetails.notes || ''\n const [warningTemplate, serverContent, clientContent] =\n errorDetails.warning || [null, '', '']\n\n const hydrationErrorType = getHydrationWarningType(warningTemplate)\n const hydrationWarning = warningTemplate\n ? warningTemplate\n .replace('%s', serverContent)\n .replace('%s', clientContent)\n .replace('%s', '') // remove the %s for stack\n .replace(/%s$/, '') // If there's still a %s at the end, remove it\n .replace(/^Warning: /, '')\n .replace(/^Error: /, '')\n : null\n\n return (\n <Overlay>\n <Dialog\n type=\"error\"\n aria-labelledby=\"nextjs__container_errors_label\"\n aria-describedby=\"nextjs__container_errors_desc\"\n onClose={isServerError ? undefined : minimize}\n >\n <DialogContent>\n <DialogHeader className=\"nextjs-container-errors-header\">\n <LeftRightDialogHeader\n previous={activeIdx > 0 ? previous : null}\n next={activeIdx < readyErrors.length - 1 ? next : null}\n close={isServerError ? undefined : minimize}\n >\n <small>\n <span>{activeIdx + 1}</span> of{' '}\n <span data-nextjs-dialog-header-total-count>\n {readyErrors.length}\n </span>\n {' issue'}\n {readyErrors.length < 2 ? '' : 's'}\n </small>\n <VersionStalenessInfo versionInfo={versionInfo} />\n </LeftRightDialogHeader>\n\n <div\n className=\"nextjs__container_errors__error_title\"\n data-nextjs-error-code={extractNextErrorCode(error)} // allow assertion in tests before error rating is implemented\n >\n <h1\n id=\"nextjs__container_errors_label\"\n className=\"nextjs__container_errors_label\"\n >\n {isServerError\n ? 'Server Error'\n : isUnhandledError\n ? 'Console Error'\n : 'Unhandled Runtime Error'}\n </h1>\n <span>\n <CopyButton\n data-nextjs-data-runtime-error-copy-stack\n actionLabel=\"Copy error stack\"\n successLabel=\"Copied\"\n content={error.stack || ''}\n disabled={!error.stack}\n />\n\n <NodejsInspectorCopyButton\n devtoolsFrontendUrl={debugInfo?.devtoolsFrontendUrl}\n />\n </span>\n </div>\n <p\n id=\"nextjs__container_errors_desc\"\n className=\"nextjs__container_errors_desc\"\n >\n <ErrorDescription\n error={error}\n hydrationWarning={hydrationWarning}\n />\n </p>\n {notes ? (\n <>\n <p\n id=\"nextjs__container_errors__notes\"\n className=\"nextjs__container_errors__notes\"\n >\n {notes}\n </p>\n </>\n ) : null}\n {hydrationWarning ? (\n <p\n id=\"nextjs__container_errors__link\"\n className=\"nextjs__container_errors__link\"\n >\n <HotlinkedText text=\"See more info here: https://nextjs.org/docs/messages/react-hydration-error\" />\n </p>\n ) : null}\n\n {hydrationWarning &&\n (activeError.componentStackFrames?.length ||\n !!errorDetails.reactOutputComponentDiff) ? (\n <PseudoHtmlDiff\n className=\"nextjs__container_errors__component-stack\"\n hydrationMismatchType={hydrationErrorType}\n firstContent={serverContent}\n secondContent={clientContent}\n reactOutputComponentDiff={\n errorDetails.reactOutputComponentDiff || ''\n }\n />\n ) : null}\n {isServerError ? (\n <div>\n <small>\n This error happened while generating the page. Any console\n logs will be displayed in the terminal window.\n </small>\n </div>\n ) : undefined}\n </DialogHeader>\n <Suspense fallback={<div data-nextjs-error-suspended />}>\n <DialogBody className=\"nextjs-container-errors-body\">\n <RuntimeError\n key={activeError.id.toString()}\n error={activeError}\n />\n </DialogBody>\n </Suspense>\n </DialogContent>\n </Dialog>\n </Overlay>\n )\n}\n\nexport const styles = css`\n .nextjs-error-with-static {\n bottom: calc(var(--size-gap-double) * 4.5);\n }\n .nextjs-container-errors-header {\n position: relative;\n }\n .nextjs-container-errors-header > h1 {\n font-size: var(--size-font-big);\n line-height: var(--size-font-bigger);\n font-weight: bold;\n margin: calc(var(--size-gap-double) * 1.5) 0;\n color: var(--color-title-h1);\n }\n .nextjs-container-errors-header small {\n font-size: var(--size-font-small);\n color: var(--color-accents-1);\n margin-left: var(--size-gap-double);\n }\n .nextjs-container-errors-header small > span {\n font-family: var(--font-stack-monospace);\n }\n .nextjs-container-errors-header p {\n font-size: var(--size-font-small);\n line-height: var(--size-font-big);\n white-space: pre-wrap;\n }\n .nextjs__container_errors_desc {\n font-family: var(--font-stack-monospace);\n padding: var(--size-gap) var(--size-gap-double);\n border-left: 2px solid var(--color-text-color-red-1);\n margin-top: var(--size-gap);\n font-weight: bold;\n color: var(--color-text-color-red-1);\n background-color: var(--color-text-background-red-1);\n }\n p.nextjs__container_errors__link {\n margin: var(--size-gap-double) auto;\n color: var(--color-text-color-red-1);\n font-weight: 600;\n font-size: 15px;\n }\n p.nextjs__container_errors__notes {\n margin: var(--size-gap-double) auto;\n color: var(--color-stack-notes);\n font-weight: 600;\n font-size: 15px;\n }\n .nextjs-container-errors-header > div > small {\n margin: 0;\n margin-top: var(--size-gap-half);\n }\n .nextjs-container-errors-header > p > a {\n color: inherit;\n font-weight: bold;\n }\n .nextjs-container-errors-body > h2:not(:first-child) {\n margin-top: calc(var(--size-gap-double) + var(--size-gap));\n }\n .nextjs-container-errors-body > h2 {\n color: var(--color-title-color);\n margin-bottom: var(--size-gap);\n font-size: var(--size-font-big);\n }\n .nextjs__container_errors__component-stack {\n padding: 12px 32px;\n color: var(--color-ansi-fg);\n background: var(--color-ansi-bg);\n }\n .nextjs-toast-errors-parent {\n cursor: pointer;\n transition: transform 0.2s ease;\n }\n .nextjs-toast-errors-parent:hover {\n transform: scale(1.1);\n }\n .nextjs-toast-errors {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n }\n .nextjs-toast-errors > svg {\n margin-right: var(--size-gap);\n }\n .nextjs-toast-hide-button {\n margin-left: var(--size-gap-triple);\n border: none;\n background: none;\n color: var(--color-ansi-bright-white);\n padding: 0;\n transition: opacity 0.25s ease;\n opacity: 0.7;\n }\n .nextjs-toast-hide-button:hover {\n opacity: 1;\n }\n .nextjs-container-errors-header\n > .nextjs-container-build-error-version-status {\n position: absolute;\n top: 0;\n right: 0;\n }\n .nextjs__container_errors_inspect_copy_button {\n cursor: pointer;\n background: none;\n border: none;\n color: var(--color-ansi-bright-white);\n font-size: 1.5rem;\n padding: 0;\n margin: 0;\n margin-left: var(--size-gap);\n transition: opacity 0.25s ease;\n }\n .nextjs__container_errors__error_title {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n .nextjs-data-runtime-error-inspect-link,\n .nextjs-data-runtime-error-inspect-link:hover {\n margin: 0 8px;\n color: inherit;\n }\n`\n"],"names":["useState","useEffect","useMemo","useCallback","Suspense","ACTION_UNHANDLED_ERROR","ACTION_UNHANDLED_REJECTION","Dialog","DialogBody","DialogContent","DialogHeader","LeftRightDialogHeader","Overlay","Toast","getErrorByType","noop","css","CloseIcon","RuntimeError","VersionStalenessInfo","getErrorSource","HotlinkedText","PseudoHtmlDiff","getHydrationWarningType","NodejsInspectorCopyButton","CopyButton","getUnhandledErrorType","isUnhandledConsoleOrRejection","extractNextErrorCode","isNextjsLink","text","startsWith","ErrorDescription","error","hydrationWarning","isUnhandledOrReplayError","unhandledErrorType","isConsoleErrorStringMessage","title","name","environmentName","envPrefix","message","matcher","getErrorSignature","ev","event","type","reason","stack","_","Errors","isAppDir","errors","initialDisplayState","versionInfo","hasStaticIndicator","debugInfo","activeError","lookups","setLookups","readyErrors","nextError","ready","next","idx","length","e","id","push","prev","isLoading","Boolean","mounted","then","resolved","m","displayState","setDisplayState","activeIdx","setActiveIndex","previous","v","Math","max","min","minimize","hide","fullscreen","data-nextjs-toast","data-issues","className","onClick","div","svg","xmlns","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","circle","cx","cy","r","line","x1","y1","x2","y2","span","data-issues-count","button","data-nextjs-toast-errors-hide-button","stopPropagation","aria-label","isServerError","includes","isUnhandledError","errorDetails","details","notes","warningTemplate","serverContent","clientContent","warning","hydrationErrorType","replace","aria-labelledby","aria-describedby","onClose","undefined","close","small","data-nextjs-dialog-header-total-count","data-nextjs-error-code","h1","data-nextjs-data-runtime-error-copy-stack","actionLabel","successLabel","content","disabled","devtoolsFrontendUrl","p","componentStackFrames","reactOutputComponentDiff","hydrationMismatchType","firstContent","secondContent","fallback","data-nextjs-error-suspended","toString","styles"],"mappings":";;;;;;;;;;;AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,OAAO,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,QAAO;AAC3E,SACEC,sBAAsB,EACtBC,0BAA0B,QAGrB,eAAc;AAErB,SACEC,MAAM,EACNC,UAAU,EACVC,aAAa,EACbC,YAAY,QACP,uBAAsB;AAC7B,SAASC,qBAAqB,QAAQ,sCAAqC;AAC3E,SAASC,OAAO,QAAQ,wBAAuB;AAC/C,SAASC,KAAK,QAAQ,sBAAqB;AAC3C,SAASC,cAAc,QAAQ,+BAA8B;AAE7D,SAASC,QAAQC,GAAG,QAAQ,2BAA0B;AACtD,SAASC,SAAS,QAAQ,qBAAoB;AAC9C,SAASC,YAAY,QAAQ,iBAAgB;AAC7C,SAASC,oBAAoB,QAAQ,qCAAoC;AAEzE,SAASC,cAAc,QAAQ,yCAAwC;AACvE,SAASC,aAAa,QAAQ,gCAA+B;AAC7D,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAEEC,uBAAuB,QAClB,uCAAsC;AAC7C,SAASC,yBAAyB,QAAQ,iCAAgC;AAC1E,SAASC,UAAU,QAAQ,4BAA2B;AACtD,SACEC,qBAAqB,EACrBC,6BAA6B,QACxB,gCAA+B;AACtC,SAASC,oBAAoB,QAAQ,2CAA0C;AAmB/E,SAASC,aAAaC,IAAY;IAChC,OAAOA,KAAKC,UAAU,CAAC;AACzB;AAEA,SAASC,iBAAiB,KAMzB;IANyB,IAAA,EACxBC,KAAK,EACLC,gBAAgB,EAIjB,GANyB;IAOxB,MAAMC,2BAA2BR,8BAA8BM;IAC/D,MAAMG,qBAAqBD,2BACvBT,sBAAsBO,SACtB;IACJ,MAAMI,8BAA8BD,uBAAuB;IAC3D,mBAAmB;IACnB,sBAAsB;IACtB,kDAAkD;IAClD,iCAAiC;IACjC,MAAME,QACJ,AAACH,4BAA4BE,+BAC7BH,mBACI,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extjs-container-errors-pseudo-html--tag-adjacent': isAdj
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* Format component stack into pseudo HTML
|
|
13
|
-
* component stack is an array of strings, e.g.: ['p', 'p', 'Page', ...]
|
|
14
|
-
*
|
|
15
|
-
* For html tags mismatch, it will render it for the code block
|
|
16
|
-
*
|
|
17
|
-
* ```
|
|
18
|
-
* <pre>
|
|
19
|
-
* <code>{`
|
|
20
|
-
* <Page>
|
|
21
|
-
* <p red>
|
|
22
|
-
* <p red>
|
|
23
|
-
* `}</code>
|
|
24
|
-
* </pre>
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* For text mismatch, it will render it for the code block
|
|
28
|
-
*
|
|
29
|
-
* ```
|
|
30
|
-
* <pre>
|
|
31
|
-
* <code>{`
|
|
32
|
-
* <Page>
|
|
33
|
-
* <p>
|
|
34
|
-
* "Server Text" (green)
|
|
35
|
-
* "Client Text" (red)
|
|
36
|
-
* </p>
|
|
37
|
-
* </Page>
|
|
38
|
-
* `}</code>
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* For bad text under a tag it will render it for the code block,
|
|
42
|
-
* e.g. "Mismatched Text" under <p>
|
|
43
|
-
*
|
|
44
|
-
* ```
|
|
45
|
-
* <pre>
|
|
46
|
-
* <code>{`
|
|
47
|
-
* <Page>
|
|
48
|
-
* <div>
|
|
49
|
-
* <p>
|
|
50
|
-
* "Mismatched Text" (red)
|
|
51
|
-
* </p>
|
|
52
|
-
* </div>
|
|
53
|
-
* </Page>
|
|
54
|
-
* `}</code>
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
*/ export function PseudoHtmlDiff(param) {
|
|
58
|
-
let { componentStackFrames, firstContent, secondContent, hydrationMismatchType, reactOutputComponentDiff, ...props } = param;
|
|
59
|
-
const isHtmlTagsWarning = hydrationMismatchType === 'tag';
|
|
60
|
-
const isReactHydrationDiff = !!reactOutputComponentDiff;
|
|
61
|
-
// For text mismatch, mismatched text will take 2 rows, so we display 4 rows of component stack
|
|
62
|
-
const MAX_NON_COLLAPSED_FRAMES = isHtmlTagsWarning ? 6 : 4;
|
|
63
|
-
const [isHtmlCollapsed, toggleCollapseHtml] = useState(true);
|
|
64
|
-
const htmlComponents = useMemo(()=>{
|
|
65
|
-
const componentStacks = [];
|
|
66
|
-
// React 19 unified mismatch
|
|
67
|
-
if (isReactHydrationDiff) {
|
|
68
|
-
let currentComponentIndex = componentStackFrames.length - 1;
|
|
69
|
-
const reactComponentDiffLines = reactOutputComponentDiff.split('\n');
|
|
70
|
-
const diffHtmlStack = [];
|
|
71
|
-
reactComponentDiffLines.forEach((line, index)=>{
|
|
72
|
-
let trimmedLine = line.trim();
|
|
73
|
-
const isDiffLine = trimmedLine[0] === '+' || trimmedLine[0] === '-';
|
|
74
|
-
const spaces = ' '.repeat(Math.max(componentStacks.length * 2, 1));
|
|
75
|
-
if (isDiffLine) {
|
|
76
|
-
const sign = trimmedLine[0];
|
|
77
|
-
trimmedLine = trimmedLine.slice(1).trim() // trim spaces after sign
|
|
78
|
-
;
|
|
79
|
-
diffHtmlStack.push(/*#__PURE__*/ _jsxs("span", {
|
|
80
|
-
"data-nextjs-container-errors-pseudo-html--diff": sign === '+' ? 'add' : 'remove',
|
|
81
|
-
children: [
|
|
82
|
-
sign,
|
|
83
|
-
spaces,
|
|
84
|
-
trimmedLine,
|
|
85
|
-
'\n'
|
|
86
|
-
]
|
|
87
|
-
}, 'comp-diff' + index));
|
|
88
|
-
} else if (currentComponentIndex >= 0) {
|
|
89
|
-
const isUserLandComponent = trimmedLine.startsWith('<' + componentStackFrames[currentComponentIndex].component);
|
|
90
|
-
// If it's matched userland component or it's ... we will keep the component stack in diff
|
|
91
|
-
if (isUserLandComponent || trimmedLine === '...') {
|
|
92
|
-
currentComponentIndex--;
|
|
93
|
-
componentStacks.push(/*#__PURE__*/ _jsxs("span", {
|
|
94
|
-
children: [
|
|
95
|
-
spaces,
|
|
96
|
-
trimmedLine,
|
|
97
|
-
'\n'
|
|
98
|
-
]
|
|
99
|
-
}, 'comp-diff' + index));
|
|
100
|
-
} else if (!isHtmlCollapsed) {
|
|
101
|
-
componentStacks.push(/*#__PURE__*/ _jsxs("span", {
|
|
102
|
-
children: [
|
|
103
|
-
spaces,
|
|
104
|
-
trimmedLine,
|
|
105
|
-
'\n'
|
|
106
|
-
]
|
|
107
|
-
}, 'comp-diff' + index));
|
|
108
|
-
}
|
|
109
|
-
} else if (!isHtmlCollapsed) {
|
|
110
|
-
// In general, if it's not collapsed, show the whole diff
|
|
111
|
-
componentStacks.push(/*#__PURE__*/ _jsxs("span", {
|
|
112
|
-
children: [
|
|
113
|
-
spaces,
|
|
114
|
-
trimmedLine,
|
|
115
|
-
'\n'
|
|
116
|
-
]
|
|
117
|
-
}, 'comp-diff' + index));
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
return componentStacks.concat(diffHtmlStack);
|
|
121
|
-
}
|
|
122
|
-
const nestedHtmlStack = [];
|
|
123
|
-
const tagNames = isHtmlTagsWarning ? [
|
|
124
|
-
firstContent.replace(/<|>/g, ''),
|
|
125
|
-
secondContent.replace(/<|>/g, '')
|
|
126
|
-
] : [];
|
|
127
|
-
let lastText = '';
|
|
128
|
-
const componentStack = componentStackFrames.map((frame)=>frame.component).reverse();
|
|
129
|
-
// [child index, parent index]
|
|
130
|
-
const matchedIndex = [
|
|
131
|
-
-1,
|
|
132
|
-
-1
|
|
133
|
-
];
|
|
134
|
-
if (isHtmlTagsWarning) {
|
|
135
|
-
// Reverse search for the child tag
|
|
136
|
-
for(let i = componentStack.length - 1; i >= 0; i--){
|
|
137
|
-
if (componentStack[i] === tagNames[0]) {
|
|
138
|
-
matchedIndex[0] = i;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
// Start searching parent tag from child tag above
|
|
143
|
-
for(let i = matchedIndex[0] - 1; i >= 0; i--){
|
|
144
|
-
if (componentStack[i] === tagNames[1]) {
|
|
145
|
-
matchedIndex[1] = i;
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
componentStack.forEach((component, index, componentList)=>{
|
|
151
|
-
const spaces = ' '.repeat(nestedHtmlStack.length * 2);
|
|
152
|
-
// When component is the server or client tag name, highlight it
|
|
153
|
-
const isHighlightedTag = isHtmlTagsWarning ? index === matchedIndex[0] || index === matchedIndex[1] : tagNames.includes(component);
|
|
154
|
-
const isAdjacentTag = isHighlightedTag || Math.abs(index - matchedIndex[0]) <= 1 || Math.abs(index - matchedIndex[1]) <= 1;
|
|
155
|
-
const isLastFewFrames = !isHtmlTagsWarning && index >= componentList.length - 6;
|
|
156
|
-
const adjProps = getAdjacentProps(isAdjacentTag);
|
|
157
|
-
if (isHtmlTagsWarning && isAdjacentTag || isLastFewFrames) {
|
|
158
|
-
const codeLine = /*#__PURE__*/ _jsxs("span", {
|
|
159
|
-
children: [
|
|
160
|
-
spaces,
|
|
161
|
-
/*#__PURE__*/ _jsx("span", {
|
|
162
|
-
...adjProps,
|
|
163
|
-
...isHighlightedTag ? {
|
|
164
|
-
'data-nextjs-container-errors-pseudo-html--tag-error': true
|
|
165
|
-
} : undefined,
|
|
166
|
-
children: "<" + component + ">\n"
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
});
|
|
170
|
-
lastText = component;
|
|
171
|
-
const wrappedCodeLine = /*#__PURE__*/ _jsxs(Fragment, {
|
|
172
|
-
children: [
|
|
173
|
-
codeLine,
|
|
174
|
-
isHighlightedTag && /*#__PURE__*/ _jsx("span", {
|
|
175
|
-
"data-nextjs-container-errors-pseudo-html--hint": true,
|
|
176
|
-
children: spaces + '^'.repeat(component.length + 2) + '\n'
|
|
177
|
-
})
|
|
178
|
-
]
|
|
179
|
-
}, nestedHtmlStack.length);
|
|
180
|
-
nestedHtmlStack.push(wrappedCodeLine);
|
|
181
|
-
} else {
|
|
182
|
-
if (nestedHtmlStack.length >= MAX_NON_COLLAPSED_FRAMES && isHtmlCollapsed) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
if (!isHtmlCollapsed || isLastFewFrames) {
|
|
186
|
-
nestedHtmlStack.push(/*#__PURE__*/ _createElement("span", {
|
|
187
|
-
...adjProps,
|
|
188
|
-
key: nestedHtmlStack.length,
|
|
189
|
-
children: [
|
|
190
|
-
spaces,
|
|
191
|
-
'<' + component + '>\n'
|
|
192
|
-
]
|
|
193
|
-
}));
|
|
194
|
-
} else if (isHtmlCollapsed && lastText !== '...') {
|
|
195
|
-
lastText = '...';
|
|
196
|
-
nestedHtmlStack.push(/*#__PURE__*/ _createElement("span", {
|
|
197
|
-
...adjProps,
|
|
198
|
-
key: nestedHtmlStack.length,
|
|
199
|
-
children: [
|
|
200
|
-
spaces,
|
|
201
|
-
'...\n'
|
|
202
|
-
]
|
|
203
|
-
}));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
// Hydration mismatch: text or text-tag
|
|
208
|
-
if (!isHtmlTagsWarning) {
|
|
209
|
-
const spaces = ' '.repeat(nestedHtmlStack.length * 2);
|
|
210
|
-
let wrappedCodeLine;
|
|
211
|
-
if (hydrationMismatchType === 'text') {
|
|
212
|
-
// hydration type is "text", represent [server content, client content]
|
|
213
|
-
wrappedCodeLine = /*#__PURE__*/ _jsxs(Fragment, {
|
|
214
|
-
children: [
|
|
215
|
-
/*#__PURE__*/ _jsx("span", {
|
|
216
|
-
"data-nextjs-container-errors-pseudo-html--diff": "remove",
|
|
217
|
-
children: spaces + ('"' + firstContent + '"\n')
|
|
218
|
-
}),
|
|
219
|
-
/*#__PURE__*/ _jsx("span", {
|
|
220
|
-
"data-nextjs-container-errors-pseudo-html--diff": "add",
|
|
221
|
-
children: spaces + ('"' + secondContent + '"\n')
|
|
222
|
-
})
|
|
223
|
-
]
|
|
224
|
-
}, nestedHtmlStack.length);
|
|
225
|
-
} else if (hydrationMismatchType === 'text-in-tag') {
|
|
226
|
-
// hydration type is "text-in-tag", represent [parent tag, mismatch content]
|
|
227
|
-
wrappedCodeLine = /*#__PURE__*/ _jsxs(Fragment, {
|
|
228
|
-
children: [
|
|
229
|
-
/*#__PURE__*/ _jsx("span", {
|
|
230
|
-
"data-nextjs-container-errors-pseudo-html--tag-adjacent": true,
|
|
231
|
-
children: spaces + ("<" + secondContent + ">\n")
|
|
232
|
-
}),
|
|
233
|
-
/*#__PURE__*/ _jsx("span", {
|
|
234
|
-
"data-nextjs-container-errors-pseudo-html--diff": "remove",
|
|
235
|
-
children: spaces + (' "' + firstContent + '"\n')
|
|
236
|
-
})
|
|
237
|
-
]
|
|
238
|
-
}, nestedHtmlStack.length);
|
|
239
|
-
}
|
|
240
|
-
nestedHtmlStack.push(wrappedCodeLine);
|
|
241
|
-
}
|
|
242
|
-
return nestedHtmlStack;
|
|
243
|
-
}, [
|
|
244
|
-
componentStackFrames,
|
|
245
|
-
isHtmlCollapsed,
|
|
246
|
-
firstContent,
|
|
247
|
-
secondContent,
|
|
248
|
-
isHtmlTagsWarning,
|
|
249
|
-
hydrationMismatchType,
|
|
250
|
-
MAX_NON_COLLAPSED_FRAMES,
|
|
251
|
-
isReactHydrationDiff,
|
|
252
|
-
reactOutputComponentDiff
|
|
1
|
+
import { _ as _tagged_template_literal_loose } from "@swc/helpers/_/_tagged_template_literal_loose";
|
|
2
|
+
function _templateObject() {
|
|
3
|
+
const data = _tagged_template_literal_loose([
|
|
4
|
+
"\n [data-nextjs-container-errors-pseudo-html] {\n position: relative;\n }\n [data-nextjs-container-errors-pseudo-html-collapse-button] {\n position: absolute;\n left: 10px;\n top: 10px;\n color: inherit;\n background: none;\n border: none;\n padding: 0;\n }\n [data-nextjs-container-errors-pseudo-html-line] {\n display: inline-block;\n width: 100%;\n padding-left: var(--size-10);\n font-size: var(--size-font-small);\n line-height: calc(5 / 3);\n white-space: pre;\n }\n [data-nextjs-container-errors-pseudo-html--diff='add'] {\n color: var(--color-ansi-green);\n }\n [data-nextjs-container-errors-pseudo-html--diff='remove'] {\n color: var(--color-ansi-red);\n }\n [data-nextjs-container-errors-pseudo-html-line--error] {\n color: var(--color-ansi-yellow);\n font-weight: bold;\n }\n [data-nextjs-container-errors-pseudo-html--tag-error] {\n color: var(--color-ansi-red);\n font-weight: bold;\n }\n ",
|
|
5
|
+
"\n [data-nextjs-container-errors-pseudo-html--hint] {\n display: inline-block;\n font-size: 0;\n }\n [data-nextjs-container-errors-pseudo-html-collapse='true']\n .nextjs__container_errors__component-stack\n code {\n max-height: 100px;\n mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, black 50%);\n }\n .nextjs__container_errors__component-stack code {\n display: block;\n width: 100%;\n white-space: pre-wrap;\n scroll-snap-type: y mandatory;\n overflow-y: hidden;\n }\n [data-nextjs-container-errors-pseudo-html--diff],\n [data-nextjs-container-errors-pseudo-html-line--error] {\n scroll-snap-align: center;\n }\n"
|
|
253
6
|
]);
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
tabIndex: 10,
|
|
259
|
-
"data-nextjs-container-errors-pseudo-html-collapse": true,
|
|
260
|
-
onClick: ()=>toggleCollapseHtml(!isHtmlCollapsed),
|
|
261
|
-
children: /*#__PURE__*/ _jsx(CollapseIcon, {
|
|
262
|
-
collapsed: isHtmlCollapsed
|
|
263
|
-
})
|
|
264
|
-
}),
|
|
265
|
-
/*#__PURE__*/ _jsx("pre", {
|
|
266
|
-
...props,
|
|
267
|
-
children: /*#__PURE__*/ _jsx("code", {
|
|
268
|
-
children: htmlComponents
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
]
|
|
272
|
-
});
|
|
7
|
+
_templateObject = function() {
|
|
8
|
+
return data;
|
|
9
|
+
};
|
|
10
|
+
return data;
|
|
273
11
|
}
|
|
12
|
+
import { noop as css } from '../../helpers/noop-template';
|
|
13
|
+
export { PseudoHtmlDiff } from '../../../hydration-diff/diff-view';
|
|
14
|
+
export const styles = css(_templateObject(), '');
|
|
274
15
|
|
|
275
16
|
//# sourceMappingURL=component-stack-pseudo-html.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.tsx"],"sourcesContent":["import { useMemo, Fragment, useState } from 'react'\nimport type { ComponentStackFrame } from '../../helpers/parse-component-stack'\nimport { CollapseIcon } from '../../icons/CollapseIcon'\n\nfunction getAdjacentProps(isAdj: boolean) {\n return { 'data-nextjs-container-errors-pseudo-html--tag-adjacent': isAdj }\n}\n\n/**\n *\n * Format component stack into pseudo HTML\n * component stack is an array of strings, e.g.: ['p', 'p', 'Page', ...]\n *\n * For html tags mismatch, it will render it for the code block\n *\n * ```\n * <pre>\n * <code>{`\n * <Page>\n * <p red>\n * <p red>\n * `}</code>\n * </pre>\n * ```\n *\n * For text mismatch, it will render it for the code block\n *\n * ```\n * <pre>\n * <code>{`\n * <Page>\n * <p>\n * \"Server Text\" (green)\n * \"Client Text\" (red)\n * </p>\n * </Page>\n * `}</code>\n * ```\n *\n * For bad text under a tag it will render it for the code block,\n * e.g. \"Mismatched Text\" under <p>\n *\n * ```\n * <pre>\n * <code>{`\n * <Page>\n * <div>\n * <p>\n * \"Mismatched Text\" (red)\n * </p>\n * </div>\n * </Page>\n * `}</code>\n * ```\n *\n */\nexport function PseudoHtmlDiff({\n componentStackFrames,\n firstContent,\n secondContent,\n hydrationMismatchType,\n reactOutputComponentDiff,\n ...props\n}: {\n componentStackFrames: ComponentStackFrame[]\n firstContent: string\n secondContent: string\n reactOutputComponentDiff: string | undefined\n hydrationMismatchType: 'tag' | 'text' | 'text-in-tag'\n} & React.HTMLAttributes<HTMLPreElement>) {\n const isHtmlTagsWarning = hydrationMismatchType === 'tag'\n const isReactHydrationDiff = !!reactOutputComponentDiff\n\n // For text mismatch, mismatched text will take 2 rows, so we display 4 rows of component stack\n const MAX_NON_COLLAPSED_FRAMES = isHtmlTagsWarning ? 6 : 4\n const [isHtmlCollapsed, toggleCollapseHtml] = useState(true)\n\n const htmlComponents = useMemo(() => {\n const componentStacks: React.ReactNode[] = []\n // React 19 unified mismatch\n if (isReactHydrationDiff) {\n let currentComponentIndex = componentStackFrames.length - 1\n const reactComponentDiffLines = reactOutputComponentDiff.split('\\n')\n const diffHtmlStack: React.ReactNode[] = []\n reactComponentDiffLines.forEach((line, index) => {\n let trimmedLine = line.trim()\n const isDiffLine = trimmedLine[0] === '+' || trimmedLine[0] === '-'\n const spaces = ' '.repeat(Math.max(componentStacks.length * 2, 1))\n\n if (isDiffLine) {\n const sign = trimmedLine[0]\n trimmedLine = trimmedLine.slice(1).trim() // trim spaces after sign\n diffHtmlStack.push(\n <span\n key={'comp-diff' + index}\n data-nextjs-container-errors-pseudo-html--diff={\n sign === '+' ? 'add' : 'remove'\n }\n >\n {sign}\n {spaces}\n {trimmedLine}\n {'\\n'}\n </span>\n )\n } else if (currentComponentIndex >= 0) {\n const isUserLandComponent = trimmedLine.startsWith(\n '<' + componentStackFrames[currentComponentIndex].component\n )\n // If it's matched userland component or it's ... we will keep the component stack in diff\n if (isUserLandComponent || trimmedLine === '...') {\n currentComponentIndex--\n componentStacks.push(\n <span key={'comp-diff' + index}>\n {spaces}\n {trimmedLine}\n {'\\n'}\n </span>\n )\n } else if (!isHtmlCollapsed) {\n componentStacks.push(\n <span key={'comp-diff' + index}>\n {spaces}\n {trimmedLine}\n {'\\n'}\n </span>\n )\n }\n } else if (!isHtmlCollapsed) {\n // In general, if it's not collapsed, show the whole diff\n componentStacks.push(\n <span key={'comp-diff' + index}>\n {spaces}\n {trimmedLine}\n {'\\n'}\n </span>\n )\n }\n })\n return componentStacks.concat(diffHtmlStack)\n }\n\n const nestedHtmlStack: React.ReactNode[] = []\n const tagNames = isHtmlTagsWarning\n ? // tags could have < or > in the name, so we always remove them to match\n [firstContent.replace(/<|>/g, ''), secondContent.replace(/<|>/g, '')]\n : []\n\n let lastText = ''\n\n const componentStack = componentStackFrames\n .map((frame) => frame.component)\n .reverse()\n\n // [child index, parent index]\n const matchedIndex = [-1, -1]\n if (isHtmlTagsWarning) {\n // Reverse search for the child tag\n for (let i = componentStack.length - 1; i >= 0; i--) {\n if (componentStack[i] === tagNames[0]) {\n matchedIndex[0] = i\n break\n }\n }\n // Start searching parent tag from child tag above\n for (let i = matchedIndex[0] - 1; i >= 0; i--) {\n if (componentStack[i] === tagNames[1]) {\n matchedIndex[1] = i\n break\n }\n }\n }\n\n componentStack.forEach((component, index, componentList) => {\n const spaces = ' '.repeat(nestedHtmlStack.length * 2)\n\n // When component is the server or client tag name, highlight it\n const isHighlightedTag = isHtmlTagsWarning\n ? index === matchedIndex[0] || index === matchedIndex[1]\n : tagNames.includes(component)\n const isAdjacentTag =\n isHighlightedTag ||\n Math.abs(index - matchedIndex[0]) <= 1 ||\n Math.abs(index - matchedIndex[1]) <= 1\n\n const isLastFewFrames =\n !isHtmlTagsWarning && index >= componentList.length - 6\n\n const adjProps = getAdjacentProps(isAdjacentTag)\n\n if ((isHtmlTagsWarning && isAdjacentTag) || isLastFewFrames) {\n const codeLine = (\n <span>\n {spaces}\n <span\n {...adjProps}\n {...{\n ...(isHighlightedTag\n ? {\n 'data-nextjs-container-errors-pseudo-html--tag-error':\n true,\n }\n : undefined),\n }}\n >\n {`<${component}>\\n`}\n </span>\n </span>\n )\n lastText = component\n\n const wrappedCodeLine = (\n <Fragment key={nestedHtmlStack.length}>\n {codeLine}\n {/* Add ^^^^ to the target tags used for snapshots but not displayed for users */}\n {isHighlightedTag && (\n <span data-nextjs-container-errors-pseudo-html--hint>\n {spaces + '^'.repeat(component.length + 2) + '\\n'}\n </span>\n )}\n </Fragment>\n )\n nestedHtmlStack.push(wrappedCodeLine)\n } else {\n if (\n nestedHtmlStack.length >= MAX_NON_COLLAPSED_FRAMES &&\n isHtmlCollapsed\n ) {\n return\n }\n\n if (!isHtmlCollapsed || isLastFewFrames) {\n nestedHtmlStack.push(\n <span {...adjProps} key={nestedHtmlStack.length}>\n {spaces}\n {'<' + component + '>\\n'}\n </span>\n )\n } else if (isHtmlCollapsed && lastText !== '...') {\n lastText = '...'\n nestedHtmlStack.push(\n <span {...adjProps} key={nestedHtmlStack.length}>\n {spaces}\n {'...\\n'}\n </span>\n )\n }\n }\n })\n // Hydration mismatch: text or text-tag\n if (!isHtmlTagsWarning) {\n const spaces = ' '.repeat(nestedHtmlStack.length * 2)\n let wrappedCodeLine\n if (hydrationMismatchType === 'text') {\n // hydration type is \"text\", represent [server content, client content]\n wrappedCodeLine = (\n <Fragment key={nestedHtmlStack.length}>\n <span data-nextjs-container-errors-pseudo-html--diff=\"remove\">\n {spaces + `\"${firstContent}\"\\n`}\n </span>\n <span data-nextjs-container-errors-pseudo-html--diff=\"add\">\n {spaces + `\"${secondContent}\"\\n`}\n </span>\n </Fragment>\n )\n } else if (hydrationMismatchType === 'text-in-tag') {\n // hydration type is \"text-in-tag\", represent [parent tag, mismatch content]\n wrappedCodeLine = (\n <Fragment key={nestedHtmlStack.length}>\n <span data-nextjs-container-errors-pseudo-html--tag-adjacent>\n {spaces + `<${secondContent}>\\n`}\n </span>\n <span data-nextjs-container-errors-pseudo-html--diff=\"remove\">\n {spaces + ` \"${firstContent}\"\\n`}\n </span>\n </Fragment>\n )\n }\n nestedHtmlStack.push(wrappedCodeLine)\n }\n\n return nestedHtmlStack\n }, [\n componentStackFrames,\n isHtmlCollapsed,\n firstContent,\n secondContent,\n isHtmlTagsWarning,\n hydrationMismatchType,\n MAX_NON_COLLAPSED_FRAMES,\n isReactHydrationDiff,\n reactOutputComponentDiff,\n ])\n\n return (\n <div data-nextjs-container-errors-pseudo-html>\n <button\n tabIndex={10} // match CallStackFrame\n data-nextjs-container-errors-pseudo-html-collapse\n onClick={() => toggleCollapseHtml(!isHtmlCollapsed)}\n >\n <CollapseIcon collapsed={isHtmlCollapsed} />\n </button>\n <pre {...props}>\n <code>{htmlComponents}</code>\n </pre>\n </div>\n )\n}\n"],"names":["useMemo","Fragment","useState","CollapseIcon","getAdjacentProps","isAdj","PseudoHtmlDiff","componentStackFrames","firstContent","secondContent","hydrationMismatchType","reactOutputComponentDiff","props","isHtmlTagsWarning","isReactHydrationDiff","MAX_NON_COLLAPSED_FRAMES","isHtmlCollapsed","toggleCollapseHtml","htmlComponents","componentStacks","currentComponentIndex","length","reactComponentDiffLines","split","diffHtmlStack","forEach","line","index","trimmedLine","trim","isDiffLine","spaces","repeat","Math","max","sign","slice","push","span","data-nextjs-container-errors-pseudo-html--diff","isUserLandComponent","startsWith","component","concat","nestedHtmlStack","tagNames","replace","lastText","componentStack","map","frame","reverse","matchedIndex","i","componentList","isHighlightedTag","includes","isAdjacentTag","abs","isLastFewFrames","adjProps","codeLine","undefined","wrappedCodeLine","data-nextjs-container-errors-pseudo-html--hint","key","data-nextjs-container-errors-pseudo-html--tag-adjacent","div","data-nextjs-container-errors-pseudo-html","button","tabIndex","data-nextjs-container-errors-pseudo-html-collapse","onClick","collapsed","pre","code"],"mappings":";;AAAA,SAASA,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,QAAO;AAEnD,SAASC,YAAY,QAAQ,2BAA0B;AAEvD,SAASC,iBAAiBC,KAAc;IACtC,OAAO;QAAE,0DAA0DA;IAAM;AAC3E;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CC,GACD,OAAO,SAASC,eAAe,KAaS;IAbT,IAAA,EAC7BC,oBAAoB,EACpBC,YAAY,EACZC,aAAa,EACbC,qBAAqB,EACrBC,wBAAwB,EACxB,GAAGC,OAOmC,GAbT;IAc7B,MAAMC,oBAAoBH,0BAA0B;IACpD,MAAMI,uBAAuB,CAAC,CAACH;IAE/B,+FAA+F;IAC/F,MAAMI,2BAA2BF,oBAAoB,IAAI;IACzD,MAAM,CAACG,iBAAiBC,mBAAmB,GAAGf,SAAS;IAEvD,MAAMgB,iBAAiBlB,QAAQ;QAC7B,MAAMmB,kBAAqC,EAAE;QAC7C,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C,OAAO,IAAIX,0BAA0B,eAAe;gBAClD,4EAA4E;gBAC5EqD,gCACE,MAAC9D;;sCACC,KAACqC;4BAAK4B,wDAAsD;sCACzDnC,SAAS,CAAA,AAAC,MAAGtB,gBAAc,KAAG;;sCAEjC,KAAC6B;4BAAKC,kDAA+C;sCAClDR,SAAS,CAAA,AAAC,QAAKvB,eAAa,KAAG;;;mBALrBoC,gBAAgBvB,MAAM;YASzC;YACAuB,gBAAgBP,IAAI,CAAC0B;QACvB;QAEA,OAAOnB;IACT,GAAG;QACDrC;QACAS;QACAR;QACAC;QACAI;QACAH;QACAK;QACAD;QACAH;KACD;IAED,qBACE,MAACwD;QAAIC,0CAAwC;;0BAC3C,KAACC;gBACCC,UAAU;gBACVC,mDAAiD;gBACjDC,SAAS,IAAMvD,mBAAmB,CAACD;0BAEnC,cAAA,KAACb;oBAAasE,WAAWzD;;;0BAE3B,KAAC0D;gBAAK,GAAG9D,KAAK;0BACZ,cAAA,KAAC+D;8BAAMzD;;;;;AAIf"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/container/RuntimeError/component-stack-pseudo-html.tsx"],"sourcesContent":["import { noop as css } from '../../helpers/noop-template'\n\nexport { PseudoHtmlDiff } from '../../../hydration-diff/diff-view'\n\nexport const styles = css`\n [data-nextjs-container-errors-pseudo-html] {\n position: relative;\n }\n [data-nextjs-container-errors-pseudo-html-collapse-button] {\n position: absolute;\n left: 10px;\n top: 10px;\n color: inherit;\n background: none;\n border: none;\n padding: 0;\n }\n [data-nextjs-container-errors-pseudo-html-line] {\n display: inline-block;\n width: 100%;\n padding-left: var(--size-10);\n font-size: var(--size-font-small);\n line-height: calc(5 / 3);\n white-space: pre;\n }\n [data-nextjs-container-errors-pseudo-html--diff='add'] {\n color: var(--color-ansi-green);\n }\n [data-nextjs-container-errors-pseudo-html--diff='remove'] {\n color: var(--color-ansi-red);\n }\n [data-nextjs-container-errors-pseudo-html-line--error] {\n color: var(--color-ansi-yellow);\n font-weight: bold;\n }\n [data-nextjs-container-errors-pseudo-html--tag-error] {\n color: var(--color-ansi-red);\n font-weight: bold;\n }\n ${/* hide but text are still accessible in DOM */ ''}\n [data-nextjs-container-errors-pseudo-html--hint] {\n display: inline-block;\n font-size: 0;\n }\n [data-nextjs-container-errors-pseudo-html-collapse='true']\n .nextjs__container_errors__component-stack\n code {\n max-height: 100px;\n mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, black 50%);\n }\n .nextjs__container_errors__component-stack code {\n display: block;\n width: 100%;\n white-space: pre-wrap;\n scroll-snap-type: y mandatory;\n overflow-y: hidden;\n }\n [data-nextjs-container-errors-pseudo-html--diff],\n [data-nextjs-container-errors-pseudo-html-line--error] {\n scroll-snap-align: center;\n }\n`\n"],"names":["noop","css","PseudoHtmlDiff","styles"],"mappings":";;;;;;;;;;;AAAA,SAASA,QAAQC,GAAG,QAAQ,8BAA6B;AAEzD,SAASC,cAAc,QAAQ,oCAAmC;AAElE,OAAO,MAAMC,SAASF,uBAmC8B,IAsBnD"}
|
package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _tagged_template_literal_loose } from "@swc/helpers/_/_tagged_template_literal_loose";
|
|
2
2
|
function _templateObject() {
|
|
3
3
|
const data = _tagged_template_literal_loose([
|
|
4
|
-
"\n [data-nextjs-call-stack-frame]:not(:last-child),\n [data-nextjs-component-stack-frame]:not(:last-child) {\n margin-bottom: var(--size-gap-double);\n }\n\n [data-expand-ignore-button]:focus:not(:focus-visible),\n [data-expand-ignore-button] {\n background: none;\n border: none;\n color: var(--color-font);\n cursor: pointer;\n font-size: var(--size-font);\n margin: var(--size-gap) 0;\n padding: 0;\n text-decoration: underline;\n outline: none;\n }\n\n [data-nextjs-data-runtime-error-copy-button],\n [data-nextjs-data-runtime-error-copy-button]:focus:not(:focus-visible) {\n position: relative;\n margin-left: var(--size-gap);\n padding: 0;\n border: none;\n background: none;\n outline: none;\n }\n [data-nextjs-data-runtime-error-copy-button] > svg {\n vertical-align: middle;\n }\n .nextjs-data-runtime-error-copy-button {\n color: inherit;\n }\n .nextjs-data-runtime-error-copy-button--initial:hover {\n cursor: pointer;\n }\n .nextjs-data-runtime-error-copy-button[aria-disabled='true'] {\n opacity: 0.3;\n cursor: not-allowed;\n }\n .nextjs-data-runtime-error-copy-button--error,\n .nextjs-data-runtime-error-copy-button--error:hover {\n color: var(--color-ansi-red);\n }\n .nextjs-data-runtime-error-copy-button--success {\n color: var(--color-ansi-green);\n }\n\n [data-nextjs-call-stack-frame] > h3,\n [data-nextjs-component-stack-frame] > h3 {\n margin-top: 0;\n margin-bottom: 0;\n font-family: var(--font-stack-monospace);\n font-size: var(--size-font);\n }\n [data-nextjs-call-stack-frame] > h3[data-nextjs-frame-expanded='false'] {\n color: #666;\n display: inline-block;\n }\n [data-nextjs-call-stack-frame] > div,\n [data-nextjs-component-stack-frame] > div {\n display: flex;\n align-items: center;\n padding-left: calc(var(--size-gap) + var(--size-gap-half));\n font-size: var(--size-font-small);\n color: #999;\n }\n [data-nextjs-call-stack-frame] > div > svg,\n [data-nextjs-component-stack-frame] > [role='link'] > svg {\n width: auto;\n height: var(--size-font-small);\n margin-left: var(--size-gap);\n flex-shrink: 0;\n display: none;\n }\n\n [data-nextjs-call-stack-frame] > div[data-has-source],\n [data-nextjs-component-stack-frame] > [role='link'] {\n cursor: pointer;\n }\n [data-nextjs-call-stack-frame] > div[data-has-source]:hover,\n [data-nextjs-component-stack-frame] > [role='link']:hover {\n text-decoration: underline dotted;\n }\n [data-nextjs-call-stack-frame] > div[data-has-source] > svg,\n [data-nextjs-component-stack-frame] > [role='link'] > svg {\n display: unset;\n }\n\n [data-nextjs-call-stack-framework-icon] {\n margin-right: var(--size-gap);\n }\n [data-nextjs-call-stack-framework-icon='next'] > mask {\n mask-type: alpha;\n }\n [data-nextjs-call-stack-framework-icon='react'] {\n color: rgb(20, 158, 202);\n }\n [data-nextjs-collapsed-call-stack-details][open]\n [data-nextjs-call-stack-chevron-icon] {\n transform: rotate(90deg);\n }\n [data-nextjs-collapsed-call-stack-details] summary {\n display: flex;\n align-items: center;\n margin-bottom: var(--size-gap);\n list-style: none;\n }\n [data-nextjs-collapsed-call-stack-details] summary::-webkit-details-marker {\n display: none;\n }\n\n [data-nextjs-collapsed-call-stack-details] h3 {\n color: #666;\n }\n [data-nextjs-collapsed-call-stack-details] [data-nextjs-call-stack-frame] {\n margin-bottom: var(--size-gap-double);\n }\n
|
|
4
|
+
"\n [data-nextjs-call-stack-frame]:not(:last-child),\n [data-nextjs-component-stack-frame]:not(:last-child) {\n margin-bottom: var(--size-gap-double);\n }\n\n [data-expand-ignore-button]:focus:not(:focus-visible),\n [data-expand-ignore-button] {\n background: none;\n border: none;\n color: var(--color-font);\n cursor: pointer;\n font-size: var(--size-font);\n margin: var(--size-gap) 0;\n padding: 0;\n text-decoration: underline;\n outline: none;\n }\n\n [data-nextjs-data-runtime-error-copy-button],\n [data-nextjs-data-runtime-error-copy-button]:focus:not(:focus-visible) {\n position: relative;\n margin-left: var(--size-gap);\n padding: 0;\n border: none;\n background: none;\n outline: none;\n }\n [data-nextjs-data-runtime-error-copy-button] > svg {\n vertical-align: middle;\n }\n .nextjs-data-runtime-error-copy-button {\n color: inherit;\n }\n .nextjs-data-runtime-error-copy-button--initial:hover {\n cursor: pointer;\n }\n .nextjs-data-runtime-error-copy-button[aria-disabled='true'] {\n opacity: 0.3;\n cursor: not-allowed;\n }\n .nextjs-data-runtime-error-copy-button--error,\n .nextjs-data-runtime-error-copy-button--error:hover {\n color: var(--color-ansi-red);\n }\n .nextjs-data-runtime-error-copy-button--success {\n color: var(--color-ansi-green);\n }\n\n [data-nextjs-call-stack-frame] > h3,\n [data-nextjs-component-stack-frame] > h3 {\n margin-top: 0;\n margin-bottom: 0;\n font-family: var(--font-stack-monospace);\n font-size: var(--size-font);\n }\n [data-nextjs-call-stack-frame] > h3[data-nextjs-frame-expanded='false'] {\n color: #666;\n display: inline-block;\n }\n [data-nextjs-call-stack-frame] > div,\n [data-nextjs-component-stack-frame] > div {\n display: flex;\n align-items: center;\n padding-left: calc(var(--size-gap) + var(--size-gap-half));\n font-size: var(--size-font-small);\n color: #999;\n }\n [data-nextjs-call-stack-frame] > div > svg,\n [data-nextjs-component-stack-frame] > [role='link'] > svg {\n width: auto;\n height: var(--size-font-small);\n margin-left: var(--size-gap);\n flex-shrink: 0;\n display: none;\n }\n\n [data-nextjs-call-stack-frame] > div[data-has-source],\n [data-nextjs-component-stack-frame] > [role='link'] {\n cursor: pointer;\n }\n [data-nextjs-call-stack-frame] > div[data-has-source]:hover,\n [data-nextjs-component-stack-frame] > [role='link']:hover {\n text-decoration: underline dotted;\n }\n [data-nextjs-call-stack-frame] > div[data-has-source] > svg,\n [data-nextjs-component-stack-frame] > [role='link'] > svg {\n display: unset;\n }\n\n [data-nextjs-call-stack-framework-icon] {\n margin-right: var(--size-gap);\n }\n [data-nextjs-call-stack-framework-icon='next'] > mask {\n mask-type: alpha;\n }\n [data-nextjs-call-stack-framework-icon='react'] {\n color: rgb(20, 158, 202);\n }\n [data-nextjs-collapsed-call-stack-details][open]\n [data-nextjs-call-stack-chevron-icon] {\n transform: rotate(90deg);\n }\n [data-nextjs-collapsed-call-stack-details] summary {\n display: flex;\n align-items: center;\n margin-bottom: var(--size-gap);\n list-style: none;\n }\n [data-nextjs-collapsed-call-stack-details] summary::-webkit-details-marker {\n display: none;\n }\n\n [data-nextjs-collapsed-call-stack-details] h3 {\n color: #666;\n }\n [data-nextjs-collapsed-call-stack-details] [data-nextjs-call-stack-frame] {\n margin-bottom: var(--size-gap-double);\n }\n"
|
|
5
5
|
]);
|
|
6
6
|
_templateObject = function() {
|
|
7
7
|
return data;
|
package/dist/esm/client/components/react-dev-overlay/internal/container/RuntimeError/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/container/RuntimeError/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { CodeFrame } from '../../components/CodeFrame'\nimport {\n useFrames,\n type ReadyRuntimeError,\n} from '../../helpers/get-error-by-type'\nimport { noop as css } from '../../helpers/noop-template'\nimport { CallStackFrame } from './CallStackFrame'\n\nexport type RuntimeErrorProps = { error: ReadyRuntimeError }\n\nexport function RuntimeError({ error }: RuntimeErrorProps) {\n const [isIgnoredExpanded, setIsIgnoredExpanded] = React.useState(false)\n\n const frames = useFrames(error)\n const {\n firstFrame,\n allLeadingFrames,\n trailingCallStackFrames,\n displayedFramesCount,\n } = React.useMemo(() => {\n const filteredFrames = frames.filter((frame) =>\n isIgnoredExpanded ? true : !frame.ignored\n )\n\n const firstFirstPartyFrameIndex = filteredFrames.findIndex(\n (entry) =>\n !entry.ignored &&\n Boolean(entry.originalCodeFrame) &&\n Boolean(entry.originalStackFrame)\n )\n\n return {\n displayedFramesCount: filteredFrames.length,\n firstFrame: filteredFrames[firstFirstPartyFrameIndex] ?? null,\n allLeadingFrames:\n firstFirstPartyFrameIndex < 0\n ? []\n : filteredFrames.slice(0, firstFirstPartyFrameIndex),\n trailingCallStackFrames: filteredFrames.slice(\n firstFirstPartyFrameIndex < 0 ? 0 : firstFirstPartyFrameIndex\n ),\n }\n }, [frames, isIgnoredExpanded])\n\n return (\n <>\n {firstFrame ? (\n <>\n <h2>Source</h2>\n {allLeadingFrames.map((frame, frameIndex) => (\n <CallStackFrame\n key={`call-stack-leading-${frameIndex}`}\n frame={frame}\n />\n ))}\n <CodeFrame\n stackFrame={firstFrame.originalStackFrame!}\n codeFrame={firstFrame.originalCodeFrame!}\n />\n </>\n ) : undefined}\n\n {trailingCallStackFrames.map((frame, frameIndex) => (\n <CallStackFrame\n key={`call-stack-leading-${frameIndex}`}\n frame={frame}\n />\n ))}\n {\n // if the default displayed ignored frames count is equal equal to the total frames count, hide the button\n displayedFramesCount === frames.length && !isIgnoredExpanded ? null : (\n <button\n data-expand-ignore-button={isIgnoredExpanded}\n onClick={() => setIsIgnoredExpanded(!isIgnoredExpanded)}\n >\n {`${isIgnoredExpanded ? 'Hide' : 'Show'} ignored frames`}\n </button>\n )\n }\n </>\n )\n}\n\nexport const styles = css`\n [data-nextjs-call-stack-frame]:not(:last-child),\n [data-nextjs-component-stack-frame]:not(:last-child) {\n margin-bottom: var(--size-gap-double);\n }\n\n [data-expand-ignore-button]:focus:not(:focus-visible),\n [data-expand-ignore-button] {\n background: none;\n border: none;\n color: var(--color-font);\n cursor: pointer;\n font-size: var(--size-font);\n margin: var(--size-gap) 0;\n padding: 0;\n text-decoration: underline;\n outline: none;\n }\n\n [data-nextjs-data-runtime-error-copy-button],\n [data-nextjs-data-runtime-error-copy-button]:focus:not(:focus-visible) {\n position: relative;\n margin-left: var(--size-gap);\n padding: 0;\n border: none;\n background: none;\n outline: none;\n }\n [data-nextjs-data-runtime-error-copy-button] > svg {\n vertical-align: middle;\n }\n .nextjs-data-runtime-error-copy-button {\n color: inherit;\n }\n .nextjs-data-runtime-error-copy-button--initial:hover {\n cursor: pointer;\n }\n .nextjs-data-runtime-error-copy-button[aria-disabled='true'] {\n opacity: 0.3;\n cursor: not-allowed;\n }\n .nextjs-data-runtime-error-copy-button--error,\n .nextjs-data-runtime-error-copy-button--error:hover {\n color: var(--color-ansi-red);\n }\n .nextjs-data-runtime-error-copy-button--success {\n color: var(--color-ansi-green);\n }\n\n [data-nextjs-call-stack-frame] > h3,\n [data-nextjs-component-stack-frame] > h3 {\n margin-top: 0;\n margin-bottom: 0;\n font-family: var(--font-stack-monospace);\n font-size: var(--size-font);\n }\n [data-nextjs-call-stack-frame] > h3[data-nextjs-frame-expanded='false'] {\n color: #666;\n display: inline-block;\n }\n [data-nextjs-call-stack-frame] > div,\n [data-nextjs-component-stack-frame] > div {\n display: flex;\n align-items: center;\n padding-left: calc(var(--size-gap) + var(--size-gap-half));\n font-size: var(--size-font-small);\n color: #999;\n }\n [data-nextjs-call-stack-frame] > div > svg,\n [data-nextjs-component-stack-frame] > [role='link'] > svg {\n width: auto;\n height: var(--size-font-small);\n margin-left: var(--size-gap);\n flex-shrink: 0;\n display: none;\n }\n\n [data-nextjs-call-stack-frame] > div[data-has-source],\n [data-nextjs-component-stack-frame] > [role='link'] {\n cursor: pointer;\n }\n [data-nextjs-call-stack-frame] > div[data-has-source]:hover,\n [data-nextjs-component-stack-frame] > [role='link']:hover {\n text-decoration: underline dotted;\n }\n [data-nextjs-call-stack-frame] > div[data-has-source] > svg,\n [data-nextjs-component-stack-frame] > [role='link'] > svg {\n display: unset;\n }\n\n [data-nextjs-call-stack-framework-icon] {\n margin-right: var(--size-gap);\n }\n [data-nextjs-call-stack-framework-icon='next'] > mask {\n mask-type: alpha;\n }\n [data-nextjs-call-stack-framework-icon='react'] {\n color: rgb(20, 158, 202);\n }\n [data-nextjs-collapsed-call-stack-details][open]\n [data-nextjs-call-stack-chevron-icon] {\n transform: rotate(90deg);\n }\n [data-nextjs-collapsed-call-stack-details] summary {\n display: flex;\n align-items: center;\n margin-bottom: var(--size-gap);\n list-style: none;\n }\n [data-nextjs-collapsed-call-stack-details] summary::-webkit-details-marker {\n display: none;\n }\n\n [data-nextjs-collapsed-call-stack-details] h3 {\n color: #666;\n }\n [data-nextjs-collapsed-call-stack-details] [data-nextjs-call-stack-frame] {\n margin-bottom: var(--size-gap-double);\n }\n
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/internal/container/RuntimeError/index.tsx"],"sourcesContent":["import * as React from 'react'\nimport { CodeFrame } from '../../components/CodeFrame'\nimport {\n useFrames,\n type ReadyRuntimeError,\n} from '../../helpers/get-error-by-type'\nimport { noop as css } from '../../helpers/noop-template'\nimport { CallStackFrame } from './CallStackFrame'\n\nexport type RuntimeErrorProps = { error: ReadyRuntimeError }\n\nexport function RuntimeError({ error }: RuntimeErrorProps) {\n const [isIgnoredExpanded, setIsIgnoredExpanded] = React.useState(false)\n\n const frames = useFrames(error)\n const {\n firstFrame,\n allLeadingFrames,\n trailingCallStackFrames,\n displayedFramesCount,\n } = React.useMemo(() => {\n const filteredFrames = frames.filter((frame) =>\n isIgnoredExpanded ? true : !frame.ignored\n )\n\n const firstFirstPartyFrameIndex = filteredFrames.findIndex(\n (entry) =>\n !entry.ignored &&\n Boolean(entry.originalCodeFrame) &&\n Boolean(entry.originalStackFrame)\n )\n\n return {\n displayedFramesCount: filteredFrames.length,\n firstFrame: filteredFrames[firstFirstPartyFrameIndex] ?? null,\n allLeadingFrames:\n firstFirstPartyFrameIndex < 0\n ? []\n : filteredFrames.slice(0, firstFirstPartyFrameIndex),\n trailingCallStackFrames: filteredFrames.slice(\n firstFirstPartyFrameIndex < 0 ? 0 : firstFirstPartyFrameIndex\n ),\n }\n }, [frames, isIgnoredExpanded])\n\n return (\n <>\n {firstFrame ? (\n <>\n <h2>Source</h2>\n {allLeadingFrames.map((frame, frameIndex) => (\n <CallStackFrame\n key={`call-stack-leading-${frameIndex}`}\n frame={frame}\n />\n ))}\n <CodeFrame\n stackFrame={firstFrame.originalStackFrame!}\n codeFrame={firstFrame.originalCodeFrame!}\n />\n </>\n ) : undefined}\n\n {trailingCallStackFrames.map((frame, frameIndex) => (\n <CallStackFrame\n key={`call-stack-leading-${frameIndex}`}\n frame={frame}\n />\n ))}\n {\n // if the default displayed ignored frames count is equal equal to the total frames count, hide the button\n displayedFramesCount === frames.length && !isIgnoredExpanded ? null : (\n <button\n data-expand-ignore-button={isIgnoredExpanded}\n onClick={() => setIsIgnoredExpanded(!isIgnoredExpanded)}\n >\n {`${isIgnoredExpanded ? 'Hide' : 'Show'} ignored frames`}\n </button>\n )\n }\n </>\n )\n}\n\nexport const styles = css`\n [data-nextjs-call-stack-frame]:not(:last-child),\n [data-nextjs-component-stack-frame]:not(:last-child) {\n margin-bottom: var(--size-gap-double);\n }\n\n [data-expand-ignore-button]:focus:not(:focus-visible),\n [data-expand-ignore-button] {\n background: none;\n border: none;\n color: var(--color-font);\n cursor: pointer;\n font-size: var(--size-font);\n margin: var(--size-gap) 0;\n padding: 0;\n text-decoration: underline;\n outline: none;\n }\n\n [data-nextjs-data-runtime-error-copy-button],\n [data-nextjs-data-runtime-error-copy-button]:focus:not(:focus-visible) {\n position: relative;\n margin-left: var(--size-gap);\n padding: 0;\n border: none;\n background: none;\n outline: none;\n }\n [data-nextjs-data-runtime-error-copy-button] > svg {\n vertical-align: middle;\n }\n .nextjs-data-runtime-error-copy-button {\n color: inherit;\n }\n .nextjs-data-runtime-error-copy-button--initial:hover {\n cursor: pointer;\n }\n .nextjs-data-runtime-error-copy-button[aria-disabled='true'] {\n opacity: 0.3;\n cursor: not-allowed;\n }\n .nextjs-data-runtime-error-copy-button--error,\n .nextjs-data-runtime-error-copy-button--error:hover {\n color: var(--color-ansi-red);\n }\n .nextjs-data-runtime-error-copy-button--success {\n color: var(--color-ansi-green);\n }\n\n [data-nextjs-call-stack-frame] > h3,\n [data-nextjs-component-stack-frame] > h3 {\n margin-top: 0;\n margin-bottom: 0;\n font-family: var(--font-stack-monospace);\n font-size: var(--size-font);\n }\n [data-nextjs-call-stack-frame] > h3[data-nextjs-frame-expanded='false'] {\n color: #666;\n display: inline-block;\n }\n [data-nextjs-call-stack-frame] > div,\n [data-nextjs-component-stack-frame] > div {\n display: flex;\n align-items: center;\n padding-left: calc(var(--size-gap) + var(--size-gap-half));\n font-size: var(--size-font-small);\n color: #999;\n }\n [data-nextjs-call-stack-frame] > div > svg,\n [data-nextjs-component-stack-frame] > [role='link'] > svg {\n width: auto;\n height: var(--size-font-small);\n margin-left: var(--size-gap);\n flex-shrink: 0;\n display: none;\n }\n\n [data-nextjs-call-stack-frame] > div[data-has-source],\n [data-nextjs-component-stack-frame] > [role='link'] {\n cursor: pointer;\n }\n [data-nextjs-call-stack-frame] > div[data-has-source]:hover,\n [data-nextjs-component-stack-frame] > [role='link']:hover {\n text-decoration: underline dotted;\n }\n [data-nextjs-call-stack-frame] > div[data-has-source] > svg,\n [data-nextjs-component-stack-frame] > [role='link'] > svg {\n display: unset;\n }\n\n [data-nextjs-call-stack-framework-icon] {\n margin-right: var(--size-gap);\n }\n [data-nextjs-call-stack-framework-icon='next'] > mask {\n mask-type: alpha;\n }\n [data-nextjs-call-stack-framework-icon='react'] {\n color: rgb(20, 158, 202);\n }\n [data-nextjs-collapsed-call-stack-details][open]\n [data-nextjs-call-stack-chevron-icon] {\n transform: rotate(90deg);\n }\n [data-nextjs-collapsed-call-stack-details] summary {\n display: flex;\n align-items: center;\n margin-bottom: var(--size-gap);\n list-style: none;\n }\n [data-nextjs-collapsed-call-stack-details] summary::-webkit-details-marker {\n display: none;\n }\n\n [data-nextjs-collapsed-call-stack-details] h3 {\n color: #666;\n }\n [data-nextjs-collapsed-call-stack-details] [data-nextjs-call-stack-frame] {\n margin-bottom: var(--size-gap-double);\n }\n`\n"],"names":["React","CodeFrame","useFrames","noop","css","CallStackFrame","RuntimeError","error","isIgnoredExpanded","setIsIgnoredExpanded","useState","frames","firstFrame","allLeadingFrames","trailingCallStackFrames","displayedFramesCount","useMemo","filteredFrames","filter","frame","ignored","firstFirstPartyFrameIndex","findIndex","entry","Boolean","originalCodeFrame","originalStackFrame","length","slice","h2","map","frameIndex","stackFrame","codeFrame","undefined","button","data-expand-ignore-button","onClick","styles"],"mappings":";;;;;;;;;;;AAAA,YAAYA,WAAW,QAAO;AAC9B,SAASC,SAAS,QAAQ,6BAA4B;AACtD,SACEC,SAAS,QAEJ,kCAAiC;AACxC,SAASC,QAAQC,GAAG,QAAQ,8BAA6B;AACzD,SAASC,cAAc,QAAQ,mBAAkB;AAIjD,OAAO,SAASC,aAAa,KAA4B;IAA5B,IAAA,EAAEC,KAAK,EAAqB,GAA5B;IAC3B,MAAM,CAACC,mBAAmBC,qBAAqB,GAAGT,MAAMU,QAAQ,CAAC;IAEjE,MAAMC,SAAST,UAAUK;IACzB,MAAM,EACJK,UAAU,EACVC,gBAAgB,EAChBC,uBAAuB,EACvBC,oBAAoB,EACrB,GAAGf,MAAMgB,OAAO,CAAC;QAChB,M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15
16
|
]);
|
|
16
17
|
_templateObject = function() {
|
|
@@ -29,10 +30,11 @@ import { styles as versionStaleness } from '../components/VersionStalenessInfo';
|
|
|
29
30
|
import { styles as buildErrorStyles } from '../container/BuildError';
|
|
30
31
|
import { styles as containerErrorStyles } from '../container/Errors';
|
|
31
32
|
import { styles as containerRuntimeErrorStyles } from '../container/RuntimeError';
|
|
33
|
+
import { styles as pseudoHtmlStyles } from '../container/RuntimeError/component-stack-pseudo-html';
|
|
32
34
|
import { noop as css } from '../helpers/noop-template';
|
|
33
35
|
export function ComponentStyles() {
|
|
34
36
|
return /*#__PURE__*/ _jsx("style", {
|
|
35
|
-
children: css(_templateObject(), overlay, toast, dialog, leftRightDialogHeader, codeFrame, terminal, buildErrorStyles, containerErrorStyles, containerRuntimeErrorStyles, versionStaleness)
|
|
37
|
+
children: css(_templateObject(), overlay, toast, dialog, leftRightDialogHeader, codeFrame, terminal, buildErrorStyles, containerErrorStyles, containerRuntimeErrorStyles, versionStaleness, pseudoHtmlStyles)
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/internal/styles/ComponentStyles.tsx"],"sourcesContent":["import { styles as codeFrame } from '../components/CodeFrame/styles'\nimport { styles as dialog } from '../components/Dialog'\nimport { styles as leftRightDialogHeader } from '../components/LeftRightDialogHeader/styles'\nimport { styles as overlay } from '../components/Overlay/styles'\nimport { styles as terminal } from '../components/Terminal/styles'\nimport { styles as toast } from '../components/Toast'\nimport { styles as versionStaleness } from '../components/VersionStalenessInfo'\nimport { styles as buildErrorStyles } from '../container/BuildError'\nimport { styles as containerErrorStyles } from '../container/Errors'\nimport { styles as containerRuntimeErrorStyles } from '../container/RuntimeError'\nimport { noop as css } from '../helpers/noop-template'\n\nexport function ComponentStyles() {\n return (\n <style>\n {css`\n ${overlay}\n ${toast}\n ${dialog}\n ${leftRightDialogHeader}\n ${codeFrame}\n ${terminal}\n ${buildErrorStyles}\n ${containerErrorStyles}\n ${containerRuntimeErrorStyles}\n ${versionStaleness}\n `}\n </style>\n )\n}\n"],"names":["styles","codeFrame","dialog","leftRightDialogHeader","overlay","terminal","toast","versionStaleness","buildErrorStyles","containerErrorStyles","containerRuntimeErrorStyles","noop","css","ComponentStyles","style"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/internal/styles/ComponentStyles.tsx"],"sourcesContent":["import { styles as codeFrame } from '../components/CodeFrame/styles'\nimport { styles as dialog } from '../components/Dialog'\nimport { styles as leftRightDialogHeader } from '../components/LeftRightDialogHeader/styles'\nimport { styles as overlay } from '../components/Overlay/styles'\nimport { styles as terminal } from '../components/Terminal/styles'\nimport { styles as toast } from '../components/Toast'\nimport { styles as versionStaleness } from '../components/VersionStalenessInfo'\nimport { styles as buildErrorStyles } from '../container/BuildError'\nimport { styles as containerErrorStyles } from '../container/Errors'\nimport { styles as containerRuntimeErrorStyles } from '../container/RuntimeError'\nimport { styles as pseudoHtmlStyles } from '../container/RuntimeError/component-stack-pseudo-html'\nimport { noop as css } from '../helpers/noop-template'\n\nexport function ComponentStyles() {\n return (\n <style>\n {css`\n ${overlay}\n ${toast}\n ${dialog}\n ${leftRightDialogHeader}\n ${codeFrame}\n ${terminal}\n ${buildErrorStyles}\n ${containerErrorStyles}\n ${containerRuntimeErrorStyles}\n ${versionStaleness}\n ${pseudoHtmlStyles}\n `}\n </style>\n )\n}\n"],"names":["styles","codeFrame","dialog","leftRightDialogHeader","overlay","terminal","toast","versionStaleness","buildErrorStyles","containerErrorStyles","containerRuntimeErrorStyles","pseudoHtmlStyles","noop","css","ComponentStyles","style"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,UAAUC,SAAS,QAAQ,iCAAgC;AACpE,SAASD,UAAUE,MAAM,QAAQ,uBAAsB;AACvD,SAASF,UAAUG,qBAAqB,QAAQ,6CAA4C;AAC5F,SAASH,UAAUI,OAAO,QAAQ,+BAA8B;AAChE,SAASJ,UAAUK,QAAQ,QAAQ,gCAA+B;AAClE,SAASL,UAAUM,KAAK,QAAQ,sBAAqB;AACrD,SAASN,UAAUO,gBAAgB,QAAQ,qCAAoC;AAC/E,SAASP,UAAUQ,gBAAgB,QAAQ,0BAAyB;AACpE,SAASR,UAAUS,oBAAoB,QAAQ,sBAAqB;AACpE,SAAST,UAAUU,2BAA2B,QAAQ,4BAA2B;AACjF,SAASV,UAAUW,gBAAgB,QAAQ,wDAAuD;AAClG,SAASC,QAAQC,GAAG,QAAQ,2BAA0B;AAEtD,OAAO,SAASC;IACd,qBACE,KAACC;kBACEF,uBACGT,SACAE,OACAJ,QACAC,uBACAF,WACAI,UACAG,kBACAC,sBACAC,6BACAH,kBACAI;;AAIV"}
|
package/dist/esm/client/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import { onRecoverableError } from './react-client-callbacks/on-recoverable-erro
|
|
|
27
27
|
import tracer from './tracing/tracer';
|
|
28
28
|
import reportToSocket from './tracing/report-to-socket';
|
|
29
29
|
import { isNextRouterError } from './components/is-next-router-error';
|
|
30
|
-
export const version = "15.2.0-canary.
|
|
30
|
+
export const version = "15.2.0-canary.52";
|
|
31
31
|
export let router;
|
|
32
32
|
export const emitter = mitt();
|
|
33
33
|
const looseToArray = (input)=>[].slice.call(input);
|
|
@@ -68,14 +68,14 @@ export function createMetadataComponents({ tree, searchParams, metadataContext,
|
|
|
68
68
|
} catch (notFoundMetadataErr) {
|
|
69
69
|
// In PPR rendering we still need to throw the postpone error.
|
|
70
70
|
// If metadata is postponed, React needs to be aware of the location of error.
|
|
71
|
-
if (isPostpone(notFoundMetadataErr)) {
|
|
71
|
+
if (serveStreamingMetadata && isPostpone(notFoundMetadataErr)) {
|
|
72
72
|
throw notFoundMetadataErr;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
// In PPR rendering we still need to throw the postpone error.
|
|
77
77
|
// If metadata is postponed, React needs to be aware of the location of error.
|
|
78
|
-
if (isPostpone(metadataErr)) {
|
|
78
|
+
if (serveStreamingMetadata && isPostpone(metadataErr)) {
|
|
79
79
|
throw metadataErr;
|
|
80
80
|
}
|
|
81
81
|
// We don't actually want to error in this component. We will
|