diff --git a/packages/next/src/build/webpack/plugins/define-env-plugin.ts b/packages/next/src/build/webpack/plugins/define-env-plugin.ts index 08348354a1898..83fc3d1a566f4 100644 --- a/packages/next/src/build/webpack/plugins/define-env-plugin.ts +++ b/packages/next/src/build/webpack/plugins/define-env-plugin.ts @@ -290,7 +290,9 @@ export function getDefineEnv({ } : undefined), 'process.env.__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY': - config.experimental.newDevOverlay ?? false, + config.experimental.newDevOverlay || + // Enable the new dev overlay when PPR is enabled for testing. + process.env.__NEXT_EXPERIMENTAL_PPR === 'true', } const userDefines = config.compiler?.define ?? {} diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.tsx index ee870c4b0bc4f..e26a42e109526 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.tsx @@ -36,9 +36,7 @@ export function CodeFrame({ stackFrame, codeFrame }: CodeFrameProps) { .map((line, a) => ~(a = line.indexOf('|')) ? line.substring(0, a) + - line - .substring(a + 1) - .replace(`^\\ {${miniLeadingSpacesLength}}`, '') + line.substring(a).replace(`^\\ {${miniLeadingSpacesLength}}`, '') : line ) .join('\n') diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.tsx index e238741f80d85..a281ee3f099f9 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.tsx @@ -126,6 +126,7 @@ const DevToolsPopover = ({ return ( @@ -205,14 +207,15 @@ const IndicatorRow = ({ label, value, onClick, + ...props }: { label: string value: React.ReactNode onClick?: () => void -}) => { +} & React.HTMLAttributes) => { const Wrapper = onClick ? 'button' : 'div' return ( - + {label} {value} diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.tsx index 786a680d165a8..06a64fb38769d 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.tsx @@ -233,7 +233,8 @@ export const NextLogo = ({ aria-label="Open issues overlay" onClick={onIssuesClick} > - {issueCount} {issueCount === 1 ? 'Issue' : 'Issues'} + {issueCount}{' '} + {issueCount === 1 ? 'Issue' : 'Issues'}