morphic icon indicating copy to clipboard operation
morphic copied to clipboard

URL Error / 'ERR_INVALID_URL' The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call `.done()`. The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call `.done()`.

Open walter-grace opened this issue 10 months ago • 5 comments

I am receiving this error

at async cacheEntry.responseCache.get.routeKind (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/base-server.js:1499:28) at async eval (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/response-cache/web.js:51:36) { code: 'ERR_INVALID_URL', input: '/chat/completions' } } ⨯ unhandledRejection: Error: URL is malformed "/chat/completions". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls at validateURL (/Users/waltgrace/Desktop/morphic/node_modules/next/dist/server/web/utils.js:124:15) at new context.Request (/Users/waltgrace/Desktop/morphic/node_modules/next/dist/server/web/sandbox/context.js:344:44) ... 32 lines matching cause stack trace ... at async eval (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/response-cache/web.js:51:36) { [cause]: TypeError: Invalid URL at new URL (node:internal/url:775:36) at validateURL (/Users/waltgrace/Desktop/morphic/node_modules/next/dist/server/web/utils.js:122:23) at new context.Request (/Users/waltgrace/Desktop/morphic/node_modules/next/dist/server/web/sandbox/context.js:344:44) at fetch (webpack-internal:///(rsc)/./node_modules/next/dist/compiled/react/cjs/react.react-server.development.js:216:81) at doOriginalFetch (webpack-internal:///(rsc)/./node_modules/next/dist/esm/server/lib/patch-fetch.js:368:24) at eval (webpack-internal:///(rsc)/./node_modules/next/dist/esm/server/lib/patch-fetch.js:515:24) at eval (webpack-internal:///(rsc)/./node_modules/next/dist/esm/server/lib/trace/tracer.js:115:36) at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/next/dist/compiled/@opentelemetry/api/index.js:2:7062) at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/next/dist/compiled/@opentelemetry/api/index.js:2:518) at NoopTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/next/dist/compiled/@opentelemetry/api/index.js:2:18108) at ProxyTracer.startActiveSpan (webpack-internal:///(rsc)/./node_modules/next/dist/compiled/@opentelemetry/api/index.js:2:18869) at eval (webpack-internal:///(rsc)/./node_modules/next/dist/esm/server/lib/trace/tracer.js:97:103) at NoopContextManager.with (webpack-internal:///(rsc)/./node_modules/next/dist/compiled/@opentelemetry/api/index.js:2:7062) at ContextAPI.with (webpack-internal:///(rsc)/./node_modules/next/dist/compiled/@opentelemetry/api/index.js:2:518) at NextTracerImpl.trace (webpack-internal:///(rsc)/./node_modules/next/dist/esm/server/lib/trace/tracer.js:97:28) at patched (webpack-internal:///(rsc)/./node_modules/next/dist/esm/server/lib/patch-fetch.js:161:75) at postToApi (webpack-internal:///(rsc)/./node_modules/ai/openai/dist/index.mjs:341:28) at postJsonToApi (webpack-internal:///(rsc)/./node_modules/ai/openai/dist/index.mjs:315:7) at OpenAIChatLanguageModel.doGenerate (webpack-internal:///(rsc)/./node_modules/ai/openai/dist/index.mjs:783:28) at eval (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:840:21) at _retryWithExponentialBackoff (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:706:18) at eval (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:695:25) at experimental_generateObject (webpack-internal:///(rsc)/./node_modules/ai/dist/index.mjs:839:36) at taskManager (webpack-internal:///(rsc)/./lib/agents/task-manager.tsx:18:89) at processEvents (webpack-internal:///(rsc)/./app/action.tsx:55:91) at $$ACTION_0 (webpack-internal:///(rsc)/./app/action.tsx:104:5) at endpoint (webpack-internal:///(rsc)/./node_modules/next/dist/build/webpack/loaders/next-flight-action-entry-loader.js?actions=%5B%5B%22%2FUsers%2Fwaltgrace%2FDesktop%2Fmorphic%2Fapp%2Faction.tsx%22%2C%5B%22%24%24ACTION_0%22%5D%5D%2C%5B%22%2FUsers%2Fwaltgrace%2FDesktop%2Fmorphic%2Fnode_modules%2Fai%2Frsc%2Fdist%2Frsc-server.mjs%22%2C%5B%22%24%24ACTION_0%22%5D%5D%5D&client_imported=!:9:17) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async eval (webpack-internal:///(rsc)/./node_modules/ai/rsc/dist/rsc-server.mjs:1146:24) at async $$ACTION_0 (webpack-internal:///(rsc)/./node_modules/ai/rsc/dist/rsc-server.mjs:1142:12) at async eval (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/app-render/action-handler.js:316:31) at async handleAction (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/app-render/action-handler.js:245:9) at async renderToHTMLOrFlightImpl (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/app-render/app-render.js:873:33) at async doRender (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/base-server.js:1374:30) at async cacheEntry.responseCache.get.routeKind (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/base-server.js:1499:28) at async eval (webpack-internal:///(ssr)/./node_modules/next/dist/esm/server/response-cache/web.js:51:36) { code: 'ERR_INVALID_URL', input: '/chat/completions' }

The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call .done(). The streamable UI has been slow to update. This may be a bug or a performance issue or you forgot to call .done().

walter-grace avatar Apr 10 '24 19:04 walter-grace

Same issue ....

shenxiaozhong avatar Apr 12 '24 09:04 shenxiaozhong

Screenshot 2024-04-13 at 4 47 50 PM Hey, I also got the same error. What I did was I recloned Morphic to account for @miurla 's update and now it works correctly for me when I use OpenAI's provider for the Vercel AI SDK. The only thing I changed was that I used the shorthand import { openai } from '@ai-sdk/openai' instead of the regular import { OpenAI } from 'ai/openai' in the agents folder. Maybe try that (recloning & shorthand)?

WindEnWonder avatar Apr 13 '24 21:04 WindEnWonder

I got the same issue

Undertone0809 avatar May 01 '24 17:05 Undertone0809

Same issue. Using search API: tavily, Search Depth: advanced POST /search/___ 200 in 12559ms The streamable value has been slow to update. This may be a bug or a performance issue or you forgot to call .done().

Screenshot from 2024-09-02 10-31-04

istrategy avatar Sep 02 '24 08:09 istrategy