Skip to content

BE-4: Upgrade Next.js 12 to 14#19

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1776272360-upgrade-nextjs-14
Open

BE-4: Upgrade Next.js 12 to 14#19
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1776272360-upgrade-nextjs-14

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 15, 2026

Summary

Upgrades the Next.js framework from v12.1.0 to v14.2.x (resolved to 14.2.35), along with all required companion upgrades. The pages/ directory routing is fully preserved — no App Router migration.

Package changes:

  • next: 12.1.0 → ^14.2.0
  • react / react-dom: 17.0.2 → ^18.2.0 (required by Next.js 14)
  • eslint-config-next: 12.1.4 → ^14.2.0
  • Removed @babel/core and @babel/preset-react (no longer needed)

Code changes:

  • Deleted .babelrc to enable SWC compiler (Next.js 14 default). The config only contained @babel/preset-react, which SWC handles natively.
  • Added legacyBehavior prop to 5 <Link> components that wrap non-text children (<button>, <div>), since Next.js 13+ changed Link to automatically render an <a> tag.

Unchanged:

  • pages/ directory routing, getServerSideProps, getStaticPaths, getStaticProps — all still fully supported
  • next.config.js — no changes needed (swcMinify is default in 14)
  • No next/image migration needed (app uses plain <img> tags)

Build and lint pass. All lint warnings are pre-existing (img alt text, useEffect deps).

Review & Testing Checklist for Human

  • Verify next-sanity-image works at runtime — this package declares peerDependencies: next@^11 || ^12, so --legacy-peer-deps was required during install. Confirm Sanity image rendering still works on product pages and banners.
  • Smoke-test the app in a browser — run npm run dev and verify: homepage loads with products, product detail pages render, cart interactions work, and the success page renders correctly. React 18's automatic batching and stricter StrictMode (double-firing effects in dev) could surface subtle issues.
  • Verify Link navigation — click through all links (product cards, banner CTAs, "Continue Shopping" buttons in cart and success page) to confirm legacyBehavior preserves the expected behavior.
  • Test Stripe checkout flow if possible — the payment API route and client-side redirect are untested in this upgrade.

Notes

  • Pre-existing lint warnings (missing alt props on <img>, missing useEffect deps) were intentionally not addressed — they are unrelated to this upgrade.
  • yarn.lock was not updated since the project uses npm / package-lock.json.

Link to Devin session: https://app.devin.ai/sessions/62188216545d4df1881756c5941a963e
Requested by: @Colhodm


Open with Devin

- Upgrade next from 12.1.0 to ^14.2.0 (resolved to 14.2.35)
- Upgrade react and react-dom from 17.0.2 to ^18.2.0
- Upgrade eslint-config-next from 12.1.4 to ^14.2.0
- Remove .babelrc to enable SWC compiler (Next.js 14 default)
- Remove @babel/core and @babel/preset-react dependencies
- Add legacyBehavior prop to Link components with non-text children
  (Product, HeroBanner, FooterBanner, Cart, success page)
- pages/ directory routing preserved (no App Router migration)
- getServerSideProps, getStaticPaths, getStaticProps unchanged
- Build and lint pass successfully

Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

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.

1 participant