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/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
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.