Skip to content

fix: resolve react-beautiful-dnd invariants, controlled input warnings, and empty project link crash in React 18+#42

Open
sundar-prakash wants to merge 2 commits into
sauravhathi:mainfrom
sundar-prakash:fix-react-18-dnd-and-controlled-inputs
Open

fix: resolve react-beautiful-dnd invariants, controlled input warnings, and empty project link crash in React 18+#42
sundar-prakash wants to merge 2 commits into
sauravhathi:mainfrom
sundar-prakash:fix-react-18-dnd-and-controlled-inputs

Conversation

@sundar-prakash

Copy link
Copy Markdown

Description of Changes

This pull request addresses several runtime crashes, console warnings, and React 18 / Next.js server-side hydration bugs to make the builder production-ready and fully compatible.

1. React 18 / Next.js react-beautiful-dnd Invariant Crashes

  • The Issue: With React 18+ and Next.js SSR hydration, react-beautiful-dnd's internal defaultProps fail to merge properly on render. This caused the page to crash with three successive invariant errors:
    • Invariant failed: isDropDisabled must be a boolean
    • Invariant failed: isCombineEnabled must be a boolean
    • Invariant failed: ignoreContainerClipping must be a boolean
  • The Fix: Explicitly declared isDropDisabled={false}, isCombineEnabled={false}, and ignoreContainerClipping={false} props on all <Droppable> components across the preview files:
    • LeftSide.jsx
    • WorkExperiences.jsx
    • Projects.jsx
    • WorkExperience.jsx
  • Index Fix: Also passed down the missing index={index} prop from the loop in WorkExperiences.jsx to <WorkExperience /> draggable children.

2. Project Link Runtime Crash

  • The Issue: Adding or viewing a project without a URL specified triggered a prop type runtime exception: Failed prop type: The prop href expects a string or object in <Link>, but got undefined instead.
  • The Fix: Wrapped the Next.js <Link> tag in Projects.jsx preview component with a check {item.link && ( ... )} to only render it when a valid URL is present.

3. Controlled to Uncontrolled Component Warning

  • The Issue: When adding a project, it was initialized with { title: "" } instead of { name: "" }. Because the inputs bind to name, project.name evaluated as undefined, causing React's controlled-to-uncontrolled input warning.
  • The Fix:
    • Updated addProject.js to correctly initialize with name: "".
    • Added fallback values || "" on the value props of inputs in Project.jsx, WorkExperience.jsx, Education.jsx, PersonalInformation.jsx, and Summary.jsx to prevent React from encountering undefined value states.

How to Verify

  1. Run a clean Next.js build: npm run build or pnpm run build (now compiles with a perfect exit code 0).
  2. Add new projects, work experiences, and education blocks in development (pnpm run dev); there are no console warnings or invariant errors.

@vercel

vercel Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

@sundar-prakash is attempting to deploy a commit to the Saurav Hathi's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Premkrishnavp887 Premkrishnavp887 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build Failure: Docker image build fails during the dependency installation stage because package.json and yarn.lock are out of sync. The build uses yarn install --frozen-lockfile, which correctly enforces reproducible builds and prevents automatic lockfile updates. Please regenerate and commit the updated yarn.lock file before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants