diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/app/ReactDevOverlay.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/app/ReactDevOverlay.tsx index 8fdd2991a50dc..bd9b1801088b7 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/app/ReactDevOverlay.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/app/ReactDevOverlay.tsx @@ -43,6 +43,8 @@ export default class ReactDevOverlay extends React.PureComponent< const hasStaticIndicator = state.staticIndicator const debugInfo = state.debugInfo + const isTurbopack = !!process.env.TURBOPACK + return ( <> {isReactError ? ( @@ -61,15 +63,17 @@ export default class ReactDevOverlay extends React.PureComponent< {state.rootLayoutMissingTags?.length ? ( ) : hasBuildError ? ( ) : ( void hide: () => void hasStaticIndicator?: boolean - isTurbopackEnabled: boolean + isTurbopack: boolean }) { return ( ) } @@ -42,14 +42,14 @@ const DevToolsPopover = ({ isStaticRoute, hide, semver, - isTurbopackEnabled, + isTurbopack, }: { onIssuesClick: () => void issueCount: number isStaticRoute: boolean hide: () => void semver: string | undefined - isTurbopackEnabled: boolean + isTurbopack: boolean }) => { // TODO: close when clicking outside @@ -111,7 +111,7 @@ const DevToolsPopover = ({ ) : null}

- Turbopack {isTurbopackEnabled ? 'enabled' : 'not enabled'} + Turbopack {isTurbopack ? 'enabled' : 'not enabled'}

diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/error-overlay-layout/error-overlay-layout.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/error-overlay-layout/error-overlay-layout.tsx index 998fc6a51c6b8..3a7cd86f83a03 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/error-overlay-layout/error-overlay-layout.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/components/Errors/error-overlay-layout/error-overlay-layout.tsx @@ -66,7 +66,7 @@ export function ErrorOverlayLayout({ activeIdx, setActiveIndex, footerMessage, - isTurbopack = !!process.env.TURBOPACK, + isTurbopack, }: ErrorOverlayLayoutProps) { return ( diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/BuildError.stories.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/BuildError.stories.tsx index 53ad13ac8eda1..6b60b3b3b0fe1 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/BuildError.stories.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/BuildError.stories.tsx @@ -31,3 +31,10 @@ Expected identError: Failed to resolve import "./missing-module"`, }, }, } + +export const Turbopack: Story = { + args: { + ...Default.args, + isTurbopack: true, + }, +} diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/BuildError.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/BuildError.tsx index 7701ec8734cda..f7544818eb56f 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/BuildError.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/BuildError.tsx @@ -4,11 +4,16 @@ import { Terminal } from '../components/Terminal' import { noop as css } from '../helpers/noop-template' import { ErrorOverlayLayout } from '../components/Errors/error-overlay-layout/error-overlay-layout' -export type BuildErrorProps = { message: string; versionInfo?: VersionInfo } +export type BuildErrorProps = { + message: string + isTurbopack: boolean + versionInfo?: VersionInfo +} export const BuildError: React.FC = function BuildError({ message, versionInfo, + isTurbopack, }) { const noop = React.useCallback(() => {}, []) return ( @@ -18,6 +23,7 @@ export const BuildError: React.FC = function BuildError({ onClose={noop} versionInfo={versionInfo} footerMessage="This error occurred during the build process and can only be dismissed by fixing the error." + isTurbopack={isTurbopack} > diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.stories.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.stories.tsx index 5dd9128f9c119..a8f1009825941 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.stories.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.stories.tsx @@ -74,7 +74,14 @@ export const Default: Story = { }, initialDisplayState: 'fullscreen', hasStaticIndicator: true, - isTurbopackEnabled: true, + isTurbopack: true, + }, +} + +export const Turbopack: Story = { + args: { + ...Default.args, + isTurbopack: true, }, } diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.tsx index e37b7895957dc..244c8829bb7c3 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/Errors.tsx @@ -35,10 +35,10 @@ export type ErrorsProps = { isAppDir: boolean errors: SupportedErrorEvent[] initialDisplayState: DisplayState + isTurbopack: boolean versionInfo?: VersionInfo hasStaticIndicator?: boolean debugInfo?: DebugInfo - isTurbopackEnabled: boolean } type ReadyErrorEvent = ReadyRuntimeError @@ -110,7 +110,7 @@ export function Errors({ hasStaticIndicator, debugInfo, versionInfo, - isTurbopackEnabled, + isTurbopack, }: ErrorsProps) { const [lookups, setLookups] = useState( {} as { [eventId: string]: ReadyErrorEvent } @@ -214,7 +214,7 @@ export function Errors({ fullscreen={fullscreen} hide={hide} versionInfo={versionInfo} - isTurbopackEnabled={isTurbopackEnabled} + isTurbopack={isTurbopack} /> ) } @@ -272,6 +272,7 @@ export function Errors({ setActiveIndex={setActiveIndex} footerMessage={footerMessage} versionInfo={versionInfo} + isTurbopack={isTurbopack} >
{notes ? ( diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.stories.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.stories.tsx index ba9e611301ea2..5642d16894538 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.stories.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.stories.tsx @@ -32,3 +32,10 @@ export const SingleTag: Story = { }, }, } + +export const Turbopack: Story = { + args: { + ...Default.args, + isTurbopack: true, + }, +} diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.tsx index 2e14c1a2ca050..bdbba514da226 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.tsx @@ -5,11 +5,13 @@ import { ErrorOverlayLayout } from '../components/Errors/error-overlay-layout/er type RootLayoutMissingTagsErrorProps = { missingTags: string[] + isTurbopack: boolean versionInfo?: VersionInfo } export function RootLayoutMissingTagsError({ missingTags, + isTurbopack, versionInfo, }: RootLayoutMissingTagsErrorProps) { const noop = useCallback(() => {}, []) @@ -27,6 +29,7 @@ export function RootLayoutMissingTagsError({ } onClose={noop} versionInfo={versionInfo} + isTurbopack={isTurbopack} /> ) } diff --git a/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx b/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx index a1d470c685178..b6f3a08d3977f 100644 --- a/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx +++ b/packages/next/src/client/components/react-dev-overlay/_experimental/pages/ReactDevOverlay.tsx @@ -26,6 +26,8 @@ export default function ReactDevOverlay({ children }: ReactDevOverlayProps) { onComponentError, } = usePagesReactDevOverlay() + const isTurbopack = !!process.env.TURBOPACK + return ( <> @@ -41,6 +43,7 @@ export default function ReactDevOverlay({ children }: ReactDevOverlayProps) { ) : hasRuntimeErrors ? ( ) : ( )}