简体   繁体   中英

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

**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/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - run: npm ci
    - run: npm run build
    - run: npm run export
    
    - name: Deploy 🚀
      uses: JamesIves/github-pages-deploy-action@v4
      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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM