dissorial / doc-chatbot

Document chatbot — multiple files, topics, chat windows and chat history. Powered by GPT.
813 stars 137 forks source link

data.map is not a function #25

Closed snowbird00000 closed 1 year ago

snowbird00000 commented 1 year ago

Hiya! Thanks for this guide! I've followed every step very closely but I get this error. When skipping it and jumping to login, I cant use my google account; it doesnt let me select it or enter credentials. Could you please help out?

Thanks in advance!

Unhandled Runtime Error
TypeError: data.map is not a function

Source
pages\index.tsx (118:23) @ map

  116 | setMessageState((state) => ({
  117 |   ...state,
> 118 |   messages: data.map((message: any) => ({
      |                 ^
  119 |     type: message.sender === 'user' ? 'userMessage' : 'apiMessage',
  120 |     message: message.content,
  121 |     sourceDocs: message.sourceDocs?.map((doc: any) => ({
dissorial commented 1 year ago

Hmm that's strange because if you're not logged in, you shouldn't even be able to access the Chat page (index.tsx). The error suggests that MessageState is empty, but it's hard to know exactly where the error is coming from. Have you tried clearing your browser cache and/or trying to open the app/sign in in an incognito window?