Why is there an error during build next.js project?

Why is there an error during build next.js project?

Problem Description:

**my node.js.yml file
**


name: Node.js CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/[email protected]
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/[email protected]
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - run: npm ci
    - run: npm run build
    - run: npm run export
    
    - name: Deploy 🚀
      uses: JamesIves/[email protected]
      with:
          branch: gh-pages
          folder: out # The folder the action should deploy.

enter image description here
error here

link to my repository
https://github.com/EduardKop/web-cv-next

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  distDir: 'build',
  images: {
    loader: 'akamai',
    path: '',
  }
  
}

module.exports = nextConfig

i wrote next.config.js config. I made a commit, then set up the action as indicated above in the yaml file and got an error

Solution – 1

You should give the path of images, in error says that path can’t be less that 0 char.

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  distDir: 'build',
  images: {
    loader: 'akamai',
    path: '',
  }
  
}

module.exports = nextConfig

You should write path in path attribute.

Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Reject