ai
ai copied to clipboard
Pathname '/https,http://localhost:63450/api/chat' should have matched '/api/chat' with Next.js 14.0.2
Description
Pathname '/https,http://localhost:63450/api/chat' should have matched '/api/chat'
error when sending requests to the chat route with Next.js 14.0.2. This can be avoided by downgrading to Next.js 14.0.1.
Steps to reproduce -
- Clone the Vercel AI SDK, Next.js, and OpenAI Chat Example
- Configure the environment variable, install packages and run with
vercel deploy, then submit a prompt - the app will work as expected - Update to latest stable release of Next.js with
npm i next@latest - Run with
vercel deploy- an error will be logged
⨯ node_modules/next/dist/esm/server/web/edge-route-module-wrapper.js (58:18) @ EdgeRouteModuleWrapper.handler ⨯ Invariant: no match found for request. Pathname '/https,http://localhost:63450/api/chat' should have matched '/api/chat'
@AlexIsMaking Are you using the useChat hook?
@tgonzales yes I am, I haven't changed anything from the example project.
@AlexIsMaking I believe it is related to this issue https://github.com/vercel/next.js/issues/48295 Awaiting
@tgonzales ah, thanks for the heads up. I'll share some info on that issue too.
There are some differences though - I'm not using middleware and Next.js 14.0.1 is working for me, whereas that issue was opened for ~13.3.