The deployment was failing due to react-splitter-layout@4.0.0 incompatibility with React 19.2.0. The package only supports React 15.5.0 or 16.0.0.
Replaced react-splitter-layout with react-resizable-panels (v3.0.6), which fully supports React 19.
- ✅ Removed
react-splitter-layout: ^4.0.0from dependencies - ✅ Removed
@types/react-splitter-layout: ^4.0.0from devDependencies - ✅ Kept existing
react-resizable-panels: ^3.0.6(already installed)
Location: app/(routes)/courses/[courseId]/[chapterId]/_components/CodeEditor.tsx
Before:
import dynamic from "next/dynamic";
import "react-splitter-layout/lib/index.css";
const SplitterLayout = dynamic(() => import("react-splitter-layout"), {
ssr: false,
});
// Used as:
<SplitterLayout vertical percentage primaryMinSize={30} secondaryMinSize={20} secondaryInitialSize={50}>
<div className="h-full overflow-hidden">
<SandpackCodeEditor ... />
</div>
<div className="h-full overflow-hidden">
<SandpackPreview ... />
</div>
</SplitterLayout>After:
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/components/ui/resizable";
// Used as:
<ResizablePanelGroup direction="vertical">
<ResizablePanel defaultSize={50} minSize={30}>
<div className="h-full overflow-hidden">
<SandpackCodeEditor ... />
</div>
</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={50} minSize={20}>
<div className="h-full overflow-hidden">
<SandpackPreview ... />
</div>
</ResizablePanel>
</ResizablePanelGroup>Location: app/(routes)/courses/[courseId]/[chapterId]/[exerciseslug]/page.tsx
Before:
import dynamic from "next/dynamic";
import "react-splitter-layout/lib/index.css";
const SplitterLayout = dynamic(() => import("react-splitter-layout"), {
ssr: false,
});
// Used as:
<SplitterLayout percentage primaryMinSize={40} secondaryInitialSize={60}>
<div><ContentSection ... /></div>
<div><CodeEditor ... /></div>
</SplitterLayout>After:
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
} from "@/components/ui/resizable";
// Used as:
<ResizablePanelGroup direction="horizontal">
<ResizablePanel defaultSize={40} minSize={30}>
<ContentSection ... />
</ResizablePanel>
<ResizableHandle />
<ResizablePanel defaultSize={60} minSize={40}>
<CodeEditor ... />
</ResizablePanel>
</ResizablePanelGroup>- ✅ Modern, actively maintained package
- ✅ Full React 19 support
- ✅ Better TypeScript support
- ✅ More flexible API
- ✅ Built-in accessibility features
- ✅ Better performance (no dynamic imports needed)
- ✅ Matches your existing UI component style (already using it in the project)
Run locally to verify:
npm install
npm run dev- Commit and push these changes to GitHub
- Vercel will automatically rebuild with the fixed dependencies
- The build should now succeed without peer dependency conflicts
package.jsonapp/(routes)/courses/[courseId]/[chapterId]/_components/CodeEditor.tsxapp/(routes)/courses/[courseId]/[chapterId]/[exerciseslug]/page.tsx