miurla / babyagi-ui

BabyAGI UI is designed to make it easier to run and develop with babyagi in a web app, like a ChatGPT.
https://babyagi-ui.vercel.app
MIT License
1.31k stars 278 forks source link

Fetch Failed Error #192

Open jaimejim opened 8 months ago

jaimejim commented 8 months ago

I am sure this must be a very dumb error, so my apologies for taking your time.

The only edit I have done is creating the .env file.

My laptop: Model Name: MacBook Pro Model Identifier: MacBookPro16,2 Processor Name: Quad-Core Intel Core i7 System Version: macOS 14.1 (23B74) Kernel Version: Darwin 23.1.0

I get this error.

- event compiled successfully in 461 ms (349 modules)
[TypeError: fetch failed] { cause: [Error: AggregateError] }
- error Error: fetch failed
    at context.fetch (/Users/myuser/code/babyagi-ui/node_modules/next/dist/server/web/sandbox/context.js:260:38)
    at fetchJsonFiles (webpack-internal:///(middleware)/./src/utils/objective.ts:23:32)
    at getObjectivesExamples (webpack-internal:///(middleware)/./src/utils/objective.ts:39:36)
    at findMostRelevantObjective (webpack-internal:///(middleware)/./src/utils/objective.ts:63:28)
    at TaskRegistry.createTaskList (webpack-internal:///(middleware)/./src/lib/agents/babyelfagi/registory/taskRegistry.ts:26:116)
    at BabyElfAGI.prepare (webpack-internal:///(middleware)/./src/lib/agents/babyelfagi/executer.ts:29:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async BabyElfAGI.run (webpack-internal:///(middleware)/./src/lib/agents/base/AgentExecuter.ts:20:9) {
  name: 'TypeError',
  digest: undefined
}
Error: fetch failed
    at context.fetch (/Users/myuser/code/babyagi-ui/node_modules/next/dist/server/web/sandbox/context.js:260:38)
    at fetchJsonFiles (webpack-internal:///(middleware)/./src/utils/objective.ts:23:32)
    at getObjectivesExamples (webpack-internal:///(middleware)/./src/utils/objective.ts:39:36)
    at findMostRelevantObjective (webpack-internal:///(middleware)/./src/utils/objective.ts:63:28)
    at TaskRegistry.createTaskList (webpack-internal:///(middleware)/./src/lib/agents/babyelfagi/registory/taskRegistry.ts:26:116)
    at BabyElfAGI.prepare (webpack-internal:///(middleware)/./src/lib/agents/babyelfagi/executer.ts:29:37)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async BabyElfAGI.run (webpack-internal:///(middleware)/./src/lib/agents/base/AgentExecuter.ts:20:9) {
  cause: Error: AggregateError
      at makeNetworkError (eval at requireWithFakeGlobalScope (/Users/myuser/code/babyagi-ui/node_modules/next/dist/compiled/edge-runtime/index.js:1:970334), <anonymous>:7294:35)
      at httpNetworkFetch (eval at requireWithFakeGlobalScope (/Users/myuser/code/babyagi-ui/node_modules/next/dist/compiled/edge-runtime/index.js:1:970334), <anonymous>:12040:16)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async httpNetworkOrCacheFetch (eval at requireWithFakeGlobalScope (/Users/myuser/code/babyagi-ui/node_modules/next/dist/compiled/edge-runtime/index.js:1:970334), <anonymous>:11913:33)
      at async httpFetch (eval at requireWithFakeGlobalScope (/Users/myuser/code/babyagi-ui/node_modules/next/dist/compiled/edge-runtime/index.js:1:970334), <anonymous>:11750:37)
      at async schemeFetch (eval at requireWithFakeGlobalScope (/Users/myuser/code/babyagi-ui/node_modules/next/dist/compiled/edge-runtime/index.js:1:970334), <anonymous>:11675:18)
      at async eval (eval at requireWithFakeGlobalScope (/Users/myuser/code/babyagi-ui/node_modules/next/dist/compiled/edge-runtime/index.js:1:970334), <anonymous>:11548:20)
      at async mainFetch (eval at requireWithFakeGlobalScope (/Users/myuser/code/babyagi-ui/node_modules/next/dist/compiled/edge-runtime/index.js:1:970334), <anonymous>:11538:20)
}
- wait compiling /_error (client and server)...
- wait compiling / (client and server)...

I checked that there were no corrupted npm packages, removed node_modules directory and the package-lock.json. After running npm install again it still failed.

miurla commented 8 months ago

@jaimejim Sorry for the late reply.

This error is due to a failure in fetching the json file. Please check if the BASE_URL in the env file is correctly set.

https://github.com/miurla/babyagi-ui/blob/main/.env.example#L22-L23