Cursor deployment

Next.js Build Error After Changes

After Cursor refactored your Next.js application, the build command fails. The application won't build for production.

The refactored code violates Next.js requirements or broke the build configuration.

Error Messages You Might See

Build failed Unexpected server-only code in client component Image is missing required props API route not found
Build failedUnexpected server-only code in client componentImage is missing required propsAPI route not found

Common Causes

  1. Server component using client-only code (window, hooks in server)
  2. API route using wrong export (named instead of default)
  3. Image dimensions not specified (if using Image component)
  4. Dynamic import syntax incorrect for Next.js
  5. Environment variables not exposed to client

How to Fix It

Add 'use client' directive for client components. API routes: export default function handler(req, res) {}. Images: use next/image with width/height. Dynamic imports: dynamic(() => import('component'), {ssr: false}). Env: prefix with NEXT_PUBLIC_ for client access.

Real developers can help you.

Victor Denisov Victor Denisov Developer Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. legrab legrab I'll fill this later Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) zipking zipking I am a technologist and product builder dedicated to creating high-impact solutions at the intersection of AI and specialized markets. Currently, I am focused on PropScan (EstateGuard), an AI-driven SaaS platform tailored for the Japanese real estate industry, and exploring the potential of Archify. As an INFJ-T, I approach development with a "systems-thinking" mindset—balancing technical precision with a deep understanding of user needs. I particularly enjoy the challenge of architecting Vertical AI SaaS and optimizing Small Language Models (SLMs) to solve specific, real-world business problems. Whether I'm in a CTO-level leadership role or hands-on with the code, I thrive on building tools that turn complex data into actionable value. Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert Pratik Pratik SWE with 15+ years of experience building and maintaining web apps and extensive BE infrastructure Matt Butler Matt Butler Software Engineer @ AWS Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

What's the difference between server and client components?

Server components (default) run on server, no bundle size cost. Client need 'use client' directive, bundle included. Use server when possible.

How do I use environment variables in Next.js?

Prefix with NEXT_PUBLIC_ to expose to client. Access with process.env.NEXT_PUBLIC_VAR in browser.

Related Cursor Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help