Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix my NexJs deployment error on Vercel "No serverless pages were built"

I'm getting this error in my log when I try to deploy on vercel

Found next.config.js:
/**
 * @type {import('next').NextConfig}
 */
const nextConfig = {
  reactStrictMode: true,
  webpack(config) {
    config.module.rules.push({
      test: /\.svg$/i,
      issuer: /\.[jt]sx?$/,
      use: [{ loader: '@svgr/webpack', options: { icon: true } }],
    })
    return config
  }
}
module.exports = nextConfig
Error: No serverless pages were built. Learn More: https://err.sh/vercel/vercel/now-next-no-serverless-pages-built

I've tried deleting the node modules but that does not seem to work Please help!

like image 785
Odafe Alaiya Avatar asked Feb 03 '26 11:02

Odafe Alaiya


1 Answers

Navigate to settings of your project in Vercel dashboard

https://vercel.com/[username]/[project]/settings

Follow this process to fix:

  1. Scroll down to Node.js Version of Search for Node.js Version on the page
  2. Select a newer version, probably 16x or 18x and not 14x
  3. Click the 'SAVE' button
  4. Navigate back to Deployments https://vercel.com/[username]/[project]/deployments
  5. Click the hamburger menu (three dots) in your most recent commit
  6. Then click the 'REDEPLOY' button and make sure not to select the cache option

App should build successfully now

like image 175
Chukwuemeka Maduekwe Avatar answered Feb 06 '26 01:02

Chukwuemeka Maduekwe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!