Errors - Error getting OpenAILike models: TypeError: fetch failed

Get this error when I use any model. Web ui keeps crashing on page refresh as well

➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h + enter to show help
Error getting OpenAILike models: TypeError: fetch failed
at node:internal/deps/undici/undici:13484:13
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at runNextTicks (node:internal/process/task_queues:69:3)
at listOnTimeout (node:internal/timers:575:9)
at processTimers (node:internal/timers:549:7)
at Object.getOpenAILikeModels [as getDynamicModels] (/home/andu/bolt/app/utils/constants.ts:422:22)
at async Promise.all (index 1)
at Module.initializeModelList (/home/andu/bolt/app/utils/constants.ts:483:9)
at handleRequest (/home/andu/bolt/app/entry.server.tsx:30:3)
at handleDocumentRequest (/home/andu/bolt/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/server.js:340:12)
at requestHandler (/home/andu/bolt/node_modules/.pnpm/@remix-run+server-runtime@2.15.0_typescript@5.7.2/node_modules/@remix-run/server-runtime/dist/server.js:160:18)
at /home/andu/bolt/node_modules/.pnpm/@remix-run+dev@2.15.0_@remix-run+react@2.15.0_react-dom@18.3.1_react@18.3.1__react@18.3.1_typ_3djlhh3t6jbfog2cydlrvgreoy/node_modules/@remix-run/dev/dist/vite/cloudflare-proxy-plugin.js:70:25 {
[cause]: AggregateError:
at internalConnectMultiple (node:net:1128:18)
at internalConnectMultiple (node:net:1196:5)
at Timeout.internalConnectMultipleTimeout (node:net:1720:5)
at listOnTimeout (node:internal/timers:616:11)
at processTimers (node:internal/timers:549:7) {
code: ‘ETIMEDOUT’,
[errors]: [ [Error], [Error], [Error], [Error] ]
}
}

Running on Arch Linux (Cachyos) on a newer lenono laptop

What BaseURL/Provider did you configure for OpenAILike?

I get the error no matter what provider I select.

which version of bolt you are running?

Current Commit Version: 282beb96e2ee92ba8b1174aaaf9f270e03a288e8

can you try and see if this PR is fixing your issue

How do I pull this specific commit?

git fetch origin pull/816/head:pr-816
git checkout pr-816
2 Likes

That seems to have done the trick! Thanks guys!

2 Likes

Spoke too soon, now:

12:07:28 PM [vite] Internal server error: Cannot read properties of undefined (reading ‘toolCalls’)
at Object.flush (file:///home/andu/bolt/node_modules/ai/core/generate-text/stream-text.ts:569:33)
at invokePromiseCallback (node:internal/webstreams/util:162:10)
at Object. (node:internal/webstreams/util:167:23)
at transformStreamDefaultSinkCloseAlgorithm (node:internal/webstreams/transformstream:621:43)
at node:internal/webstreams/transformstream:379:11
at writableStreamDefaultControllerProcessClose (node:internal/webstreams/writablestream:1162:28)
at writableStreamDefaultControllerAdvanceQueueIfNeeded (node:internal/webstreams/writablestream:1242:5)
at writableStreamDefaultControllerClose (node:internal/webstreams/writablestream:1209:3)
at writableStreamClose (node:internal/webstreams/writablestream:722:3)
at writableStreamDefaultWriterClose (node:internal/webstreams/writablestream:1091:10)
at writableStreamDefaultWriterCloseWithErrorPropagation (node:internal/webstreams/writablestream:1083:10)
at node:internal/webstreams/readablestream:1558:15
at complete (node:internal/webstreams/readablestream:1437:9)
at processTicksAndRejections (node:internal/process/task_queues:105:5) (x3)

You’ll want to make sure you are pulling from the stable branch.

I am also getting this error and using a stable branch

this change is currently added to main branch.
judging by the error i am guessing you might have pulled some other pr. as it says “toolCalls” in the error

I believe this issue happens if you install using npm install instead of using pnpm install, and it could be for just one or many models, often vite having an issue or missing.

Try deleting the node_modules folder and run npm install pnpm & pnpm install & pnpm run dev.