vercel / ai-chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel
https://chat.vercel.ai
Other
5.55k stars 1.64k forks source link

chat history refresh regression #231

Open joshweir opened 5 months ago

joshweir commented 5 months ago

Seems like there is a chat history refresh regression, currently the chat history does not refresh for new chat.

It was fixed here: https://github.com/vercel/ai-chatbot/pull/161/files (I made this change locally and it fixes the bug).

Seems to have regressed here?: https://github.com/vercel/ai-chatbot/commit/c35fae4489e156ca945900784c9f09a6d67a9fa9

specifically the change made to this file: components/chat.tsx

brianprost commented 5 months ago

I think this had something to do with the NextJS 14.1 update. If you upgrade to 14.1, you get a Type error:

image

mrmps commented 4 months ago

I think this had something to do with the NextJS 14.1 update. If you upgrade to 14.1, you get a Type error:

image

Solution that worked for me is to just use:

onFinish() {
        if (!path.includes('chat')) {
          router.replace(`/chat/${id}`)
        }
      }