diff --git a/.changeset/sixty-news-fly.md b/.changeset/sixty-news-fly.md new file mode 100644 index 000000000..769eb62de --- /dev/null +++ b/.changeset/sixty-news-fly.md @@ -0,0 +1,5 @@ +--- +"@solidjs/start": patch +--- + +fix dev overlay being pulled in even when not used diff --git a/packages/start/src/shared/ErrorBoundary.tsx b/packages/start/src/shared/ErrorBoundary.tsx index 1decec18c..4f28f9ed1 100644 --- a/packages/start/src/shared/ErrorBoundary.tsx +++ b/packages/start/src/shared/ErrorBoundary.tsx @@ -1,8 +1,8 @@ // @refresh skip -import { ErrorBoundary as DefaultErrorBoundary, catchError, type ParentProps } from "solid-js"; +import { ErrorBoundary as DefaultErrorBoundary, catchError, type ParentProps, lazy } from "solid-js"; import { isServer } from "solid-js/web"; import { HttpStatusCode } from "./HttpStatusCode"; -import { DevOverlay } from "./dev-overlay"; +const DevOverlay = lazy(() => import("./dev-overlay")); export const ErrorBoundary = import.meta.env.DEV && import.meta.env.START_DEV_OVERLAY diff --git a/packages/start/src/shared/dev-overlay/index.tsx b/packages/start/src/shared/dev-overlay/index.tsx index addc7184b..6054db2b9 100644 --- a/packages/start/src/shared/dev-overlay/index.tsx +++ b/packages/start/src/shared/dev-overlay/index.tsx @@ -22,7 +22,7 @@ const DevOverlayDialog = } : /* #__PURE__ */ clientOnly(() => import("./DevOverlayDialog")); -export function DevOverlay(props: DevOverlayProps): JSX.Element { +export default function DevOverlay(props: DevOverlayProps): JSX.Element { const [errors, setErrors] = createSignal([]); function resetError() {