Estoy tratando de construir una aplicación nextjs. Funciona bien en npm run dev pero da este error cuando ejecuto npm run build
> Build error occurred FetchError: request to http://localhost:4001/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:4001 at ClientRequest.<anonymous> (/Users/naweddiwan/Desktop/codinqQuest/next-saas-starter/node_modules/node-fetch/lib/index.js:1461:11) at ClientRequest.emit (events.js:400:28) at Socket.socketErrorListener (_http_client.js:475:9) at Socket.emit (events.js:400:28) at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) at processTicksAndRejections (internal/process/task_queues.js:82:21) { type: 'system', errno: 'ECONNREFUSED', code: 'ECONNREFUSED' }¿Pueden ayudarme, qué puede estar causando este error?